Expect instead of a lousy unwrap with comment
This commit is contained in:
parent
83e4ff36e5
commit
19130056ee
1 changed files with 2 additions and 2 deletions
|
@ -22,14 +22,14 @@ pub struct Create {
|
||||||
|
|
||||||
fn msgsize_default() -> usize {
|
fn msgsize_default() -> usize {
|
||||||
match fs::read_to_string("/proc/sys/fs/mqueue/msgsize_default") {
|
match fs::read_to_string("/proc/sys/fs/mqueue/msgsize_default") {
|
||||||
Ok(m) => m.trim().parse::<usize>().unwrap(), // should never fail
|
Ok(m) => m.trim().parse::<usize>().expect("can never fail"),
|
||||||
_ => 8192,
|
_ => 8192,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn msg_default() -> usize {
|
fn msg_default() -> usize {
|
||||||
match fs::read_to_string("/proc/sys/fs/mqueue/msg_default") {
|
match fs::read_to_string("/proc/sys/fs/mqueue/msg_default") {
|
||||||
Ok(m) => m.trim().parse::<usize>().unwrap(), // should never fail
|
Ok(m) => m.trim().parse::<usize>().expect("can never fail"),
|
||||||
_ => 10,
|
_ => 10,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue