map isn't needed here

This commit is contained in:
ChristopherYoung 2024-11-29 16:44:28 +08:00
parent 79cbe89deb
commit 89630d4a57

View file

@ -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,