diff options
-rw-r--r-- | bin/core/imag-grep/src/main.rs | 8 |
1 files 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 { |