From 4579187549634ef383e09d215a7518973059a183 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 27 Aug 2019 10:32:09 +0200 Subject: [PATCH] [No-auto] bin/core/grep: Fix Clippy warnings Signed-off-by: flip1995 Signed-off-by: Matthias Beyer --- bin/core/imag-grep/src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/core/imag-grep/src/main.rs b/bin/core/imag-grep/src/main.rs index 74148cef..a7b1a1f3 100644 --- a/bin/core/imag-grep/src/main.rs +++ b/bin/core/imag-grep/src/main.rs @@ -90,8 +90,12 @@ fn main() { .map_err_trace_exit_unwrap() .into_get_iter() .filter_map(|res| res.map_err_trace_exit_unwrap()) - .filter(|entry| pattern.is_match(entry.get_content())) - .map(|entry| show(&rt, &entry, &pattern, &opts, &mut count)) + .filter_map(|entry| if pattern.is_match(entry.get_content()) { + show(&rt, &entry, &pattern, &opts, &mut count); + Some(()) + } else { + None + }) .count(); if opts.count {