From 19130056ee08cf82f02d4818b68c1714ca032beb Mon Sep 17 00:00:00 2001 From: finga Date: Sun, 27 Jun 2021 02:40:10 +0200 Subject: [PATCH] Expect instead of a lousy unwrap with comment --- src/create.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/create.rs b/src/create.rs index c55b555..eac24ac 100644 --- a/src/create.rs +++ b/src/create.rs @@ -22,14 +22,14 @@ pub struct Create { fn msgsize_default() -> usize { match fs::read_to_string("/proc/sys/fs/mqueue/msgsize_default") { - Ok(m) => m.trim().parse::().unwrap(), // should never fail + Ok(m) => m.trim().parse::().expect("can never fail"), _ => 8192, } } fn msg_default() -> usize { match fs::read_to_string("/proc/sys/fs/mqueue/msg_default") { - Ok(m) => m.trim().parse::().unwrap(), // should never fail + Ok(m) => m.trim().parse::().expect("can never fail"), _ => 10, } }