fix(lib): Trim whitespace from OS limit files
This commit is contained in:
parent
3ee616a25a
commit
c3cc663ab1
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue