From 1eae5707fef0763e26021cf0eae233117d5e534a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 6 Apr 2020 18:30:36 +0200 Subject: Fix: Collapse nested if Signed-off-by: Matthias Beyer --- bin/core/imag-grep/src/lib.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bin/core/imag-grep/src/lib.rs b/bin/core/imag-grep/src/lib.rs index 53101a3f..fd9e548c 100644 --- a/bin/core/imag-grep/src/lib.rs +++ b/bin/core/imag-grep/src/lib.rs @@ -123,13 +123,11 @@ impl ImagApplication for ImagGrep { if !rt.output_is_pipe() || rt.output_data_pipe() { writeln!(rt.stdout(), "{}", count)?; } - } else if !opts.files_with_matches { - if !rt.output_is_pipe() || rt.output_data_pipe() { - writeln!(rt.stdout(), "Processed {} files, {} matches, {} nonmatches", - overall_count, - count, - overall_count - count)?; - } + } else if !opts.files_with_matches && (!rt.output_is_pipe() || rt.output_data_pipe()) { + writeln!(rt.stdout(), "Processed {} files, {} matches, {} nonmatches", + overall_count, + count, + overall_count - count)?; } Ok(()) -- cgit v1.2.3