mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-23 08:03:47 -07:00
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
This commit is contained in:
committed by
Andrew Gallant
parent
c3828cb508
commit
83ab0a6b53
@@ -762,10 +762,8 @@ impl<'p, 's, M: Matcher, W: WriteColor> StandardSink<'p, 's, M, W> {
|
|||||||
) -> io::Result<()> {
|
) -> io::Result<()> {
|
||||||
self.replacer.clear();
|
self.replacer.clear();
|
||||||
if self.standard.config.replacement.is_some() {
|
if self.standard.config.replacement.is_some() {
|
||||||
let replacement = (*self.standard.config.replacement)
|
let replacement =
|
||||||
.as_ref()
|
(*self.standard.config.replacement).as_ref().unwrap();
|
||||||
.map(|r| &*r)
|
|
||||||
.unwrap();
|
|
||||||
self.replacer.replace_all(
|
self.replacer.replace_all(
|
||||||
searcher,
|
searcher,
|
||||||
&self.matcher,
|
&self.matcher,
|
||||||
|
Reference in New Issue
Block a user