mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-02 05:57:46 +00:00
Remove trivially unnessessary unwrap() from du
This commit is contained in:
parent
3eae399ec4
commit
774c01f008
1 changed files with 4 additions and 3 deletions
|
@ -320,8 +320,7 @@ fn du(
|
||||||
if this_stat.is_dir {
|
if this_stat.is_dir {
|
||||||
futures.push(du(this_stat, options, depth + 1, inodes));
|
futures.push(du(this_stat, options, depth + 1, inodes));
|
||||||
} else {
|
} else {
|
||||||
if this_stat.inode.is_some() {
|
if let Some(inode) = this_stat.inode {
|
||||||
let inode = this_stat.inode.unwrap();
|
|
||||||
if inodes.contains(&inode) {
|
if inodes.contains(&inode) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -360,7 +359,9 @@ fn du(
|
||||||
my_stat.size += stat.size;
|
my_stat.size += stat.size;
|
||||||
my_stat.blocks += stat.blocks;
|
my_stat.blocks += stat.blocks;
|
||||||
}
|
}
|
||||||
options.max_depth == None || depth < options.max_depth.unwrap()
|
options
|
||||||
|
.max_depth
|
||||||
|
.map_or(true, |max_depth| depth < max_depth)
|
||||||
}));
|
}));
|
||||||
stats.push(my_stat);
|
stats.push(my_stat);
|
||||||
Box::new(stats.into_iter())
|
Box::new(stats.into_iter())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue