From 83ab0a6b537f79fe1c370cd717f65e28e25349c1 Mon Sep 17 00:00:00 2001 From: ChristopherYoung Date: Fri, 29 Nov 2024 16:44:28 +0800 Subject: [PATCH] printer: slightly simplify code I'm not sure why it was written with `map` previously. It almost looks like I was trying to make it deref, but apparently that isn't needed. Closes #2941 --- crates/printer/src/standard.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/printer/src/standard.rs b/crates/printer/src/standard.rs index 6cc5374f..3b00e46e 100644 --- a/crates/printer/src/standard.rs +++ b/crates/printer/src/standard.rs @@ -762,10 +762,8 @@ impl<'p, 's, M: Matcher, W: WriteColor> StandardSink<'p, 's, M, W> { ) -> io::Result<()> { self.replacer.clear(); if self.standard.config.replacement.is_some() { - let replacement = (*self.standard.config.replacement) - .as_ref() - .map(|r| &*r) - .unwrap(); + let replacement = + (*self.standard.config.replacement).as_ref().unwrap(); self.replacer.replace_all( searcher, &self.matcher,