From 17d9ab3b24c00db53420a2bb85167f4721f42a21 Mon Sep 17 00:00:00 2001 From: metaphorics <152830360+metaphorics@users.noreply.github.com> Date: Fri, 3 Jul 2026 05:04:55 +0900 Subject: [PATCH] refactor(pi_uu_grep): behavior-preserving cleanup\n\nOp: compress --- crates/pi-uu-grep/src/rg.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/crates/pi-uu-grep/src/rg.rs b/crates/pi-uu-grep/src/rg.rs index 9a8246354..be5199c7c 100644 --- a/crates/pi-uu-grep/src/rg.rs +++ b/crates/pi-uu-grep/src/rg.rs @@ -927,16 +927,11 @@ fn process_file( opts: &SearchOptions, out: &mut W, ) -> SearchOutcome { - match File::open(path) { - Ok(file) => match process_reader(matcher, searcher, file, display, opts, out) { - Ok(any_match) => SearchOutcome { any_match, had_error: false }, - Err(err) => SearchOutcome { - any_match: false, - had_error: report_path_error(display, path, err, opts), - }, - }, - Err(err) => { - SearchOutcome { any_match: false, had_error: report_path_error(display, path, err, opts) } + match File::open(path).and_then(|file| process_reader(matcher, searcher, file, display, opts, out)) { + Ok(any_match) => SearchOutcome { any_match, had_error: false }, + Err(err) => SearchOutcome { + any_match: false, + had_error: report_path_error(display, path, err, opts), }, } }