mirror of
https://github.com/lsd-rs/lsd
synced 2024-12-15 06:22:47 +00:00
refactor(permission): replace unwrap with expect
This commit is contained in:
parent
eea9dcaa26
commit
ffa5daa3c5
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue