1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-04 15:07:47 +00:00

refactor/polish ~ fix cargo clippy complaints (filter_map => filter)

This commit is contained in:
Roy Ivy III 2019-12-25 23:42:55 -06:00
parent de9d702a32
commit f933c60a41

View file

@ -188,17 +188,13 @@ fn du(
} }
} }
stats.extend(futures.into_iter().flat_map(|val| val).rev().filter_map( stats.extend(futures.into_iter().flat_map(|val| val).rev().filter(
|stat| { |stat| {
if !options.separate_dirs && stat.path.parent().unwrap() == my_stat.path { if !options.separate_dirs && stat.path.parent().unwrap() == my_stat.path {
my_stat.size += stat.size; my_stat.size += stat.size;
my_stat.blocks += stat.blocks; my_stat.blocks += stat.blocks;
} }
if options.max_depth == None || depth < options.max_depth.unwrap() { options.max_depth == None || depth < options.max_depth.unwrap()
Some(stat)
} else {
None
}
}, },
)); ));
stats.push(my_stat); stats.push(my_stat);