From f933c60a41460258b2fd1b479015f06722fc8537 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Wed, 25 Dec 2019 23:42:55 -0600 Subject: [PATCH] refactor/polish ~ fix `cargo clippy` complaints (filter_map => filter) --- src/du/du.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/du/du.rs b/src/du/du.rs index f7560d3a8..7533c7ed4 100644 --- a/src/du/du.rs +++ b/src/du/du.rs @@ -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| { if !options.separate_dirs && stat.path.parent().unwrap() == my_stat.path { my_stat.size += stat.size; my_stat.blocks += stat.blocks; } - if options.max_depth == None || depth < options.max_depth.unwrap() { - Some(stat) - } else { - None - } + options.max_depth == None || depth < options.max_depth.unwrap() }, )); stats.push(my_stat);