260709.13 · e7b0f89e81811b295446404f02ca133fe8434054
lint: use `cloned()` or `copied()` when we can
Ref https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
Closes #3230
reading declarations
Changes to crates/core/search.rs. All files
@@ -389,7 +389,7 @@ fn search_path<M: Matcher, W: WriteColor>( searcher.search_path(&matcher, path, &mut sink)?; Ok(SearchResult { has_match: sink.has_match(),- stats: sink.stats().map(|s| s.clone()),+ stats: sink.stats().cloned(), }) } Printer::Summary(ref mut p) => {@@ -397,7 +397,7 @@ fn search_path<M: Matcher, W: WriteColor>( searcher.search_path(&matcher, path, &mut sink)?; Ok(SearchResult { has_match: sink.has_match(),- stats: sink.stats().map(|s| s.clone()),+ stats: sink.stats().cloned(), }) } Printer::JSON(ref mut p) => {@@ -426,7 +426,7 @@ fn search_reader<M: Matcher, R: io::Read, W: WriteColor>( searcher.search_reader(&matcher, &mut rdr, &mut sink)?; Ok(SearchResult { has_match: sink.has_match(),- stats: sink.stats().map(|s| s.clone()),+ stats: sink.stats().cloned(), }) } Printer::Summary(ref mut p) => {@@ -434,7 +434,7 @@ fn search_reader<M: Matcher, R: io::Read, W: WriteColor>( searcher.search_reader(&matcher, &mut rdr, &mut sink)?; Ok(SearchResult { has_match: sink.has_match(),- stats: sink.stats().map(|s| s.clone()),+ stats: sink.stats().cloned(), }) } Printer::JSON(ref mut p) => {