From ffa5daa3c52dcacb78eb27ae846c8d55eacc662e Mon Sep 17 00:00:00 2001 From: Narawit Rakket Date: Wed, 15 Jun 2022 01:53:29 +0700 Subject: [PATCH] refactor(permission): replace unwrap with expect --- src/meta/permissions.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/meta/permissions.rs b/src/meta/permissions.rs index 6f130e6..d4f131a 100644 --- a/src/meta/permissions.rs +++ b/src/meta/permissions.rs @@ -113,7 +113,10 @@ impl Permissions { ] .into_iter() .fold(String::with_capacity(4), |mut acc, x| { - acc.push(char::from_digit(x as u32, 8).unwrap()); + acc.push( + char::from_digit(x as u32, 8) + .expect("Octal value of permission should not greater than 7."), + ); acc });