diff options
author | Vincent Ambo <tazjin@gmail.com> | 2017-10-15T23·17+0200 |
---|---|---|
committer | Vincent Ambo <tazjin@gmail.com> | 2017-10-15T23·17+0200 |
commit | 3ee616a25ac3fdd602befd2f91d7e29b7a7fa14c (patch) | |
tree | 10390c473cead41f0c0eb5490f31d4bcd9873b60 /src/lib.rs | |
parent | 557655ee1d918579a40f0684cced80aa0390045c (diff) |
fix(lib): Borrow &self in send/receive
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs index ad0ead59e53a..2ae22f162893 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -185,7 +185,7 @@ impl Queue { Ok(()) } - pub fn send(self, msg: Message) -> Result<(), Error> { + pub fn send(&self, msg: Message) -> Result<(), Error> { if msg.data.len() > self.max_size as usize { return Err(Error::MessageSizeExceeded()); } @@ -197,7 +197,7 @@ impl Queue { ).map_err(|e| e.into()) } - pub fn receive(self) -> Result<Message, Error> { + pub fn receive(&self) -> Result<Message, Error> { let mut data: Vec<u8> = vec![0; self.max_size as usize]; let mut priority: u32 = 0; |