From 2e2bdac00092f8fcb96283da697a7a820a8c8978 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 12 Nov 2021 14:08:35 +0100 Subject: Minor code smell fixes --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 256de97..27ad285 100644 --- a/src/main.rs +++ b/src/main.rs @@ -155,11 +155,11 @@ impl Opt { return Ok(filter); } } - return Ok(maybe_filter?); + return maybe_filter; } let expr_string = fexpr::requote(&self.expression); - Ok(build_filter(&expr_string)?) + build_filter(&expr_string) } } @@ -369,7 +369,7 @@ fn single(opt: &Opt) -> Result { .unwrap_or(false); search_file(path, is_zip, &*filter).map(|r| r.is_some()) } else { - grep(&opt, &*filter) + grep(opt, &*filter) } } @@ -393,7 +393,7 @@ fn repl(opt: &Opt) -> Result<()> { let parsed = build_filter(&line); INTERRUPTED.store(false, Ordering::Relaxed); match parsed { - Ok(filter) => grep(&opt, &*filter).map(|_| ())?, + Ok(filter) => grep(opt, &*filter).map(|_| ())?, Err(err) => display_error(&err), } } -- cgit v1.2.3