Skip to content
Myr

printer: slightly simplify code

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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

authored by ChristopherYoung · committed by Andrew Gallant · parent 75e17fc · Browse files · 1 file+2 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−4 removed

  • other:+2 added−4 removed

1 file+2 added−4 removed

modified:crates/printer/src/standard.rs+2 added-4 removed
760 unmodified lines
761 range: std::ops::Range<usize>,762 ) -> io::Result<()> {763 self.replacer.clear();764 if self.standard.config.replacement.is_some() {765 let replacement = (*self.standard.config.replacement)766 .as_ref()767 .map(|r| &*r)768 .unwrap();765 let replacement =766 (*self.standard.config.replacement).as_ref().unwrap();767 self.replacer.replace_all(768 searcher,769 &self.matcher,770 bytes,
3070 unmodified lines