refactor(permission): replace unwrap with expect

This commit is contained in:
Narawit Rakket 2022-06-15 01:53:29 +07:00 committed by Abin Simon
parent eea9dcaa26
commit ffa5daa3c5

View file

@ -113,7 +113,10 @@ impl Permissions {
] ]
.into_iter() .into_iter()
.fold(String::with_capacity(4), |mut acc, x| { .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 acc
}); });