about summary refs log tree commit diff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-10-15T23·52+0200
committerVincent Ambo <tazjin@gmail.com>2017-10-15T23·52+0200
commitc3cc663ab1eafec38033a845c37d8766b334d321 (patch)
tree02350474c3b1e241ecce6b3b4efc579ebd1eebdb /src/lib.rs
parent3ee616a25ac3fdd602befd2f91d7e29b7a7fa14c (diff)
fix(lib): Trim whitespace from OS limit files
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 2ae22f162893..877017e89308 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());
         }
@@ -245,7 +245,7 @@ fn read_i64_from_file(name: &str) -> Result<i64, Error> {
     let mut file = File::open(name.to_string())?;
     let mut content = String::new();
     file.read_to_string(&mut content)?;
-    Ok(content.parse()?)
+    Ok(content.trim().parse()?)
 }
 
 /// The mq_getattr implementation in the nix crate hides the maximum message size and count, which