Enable clippy::iter_overeager_cloned (#8839)

This PR enables the
[`clippy::iter_overeager_cloned`](https://rust-lang.github.io/rust-clippy/master/index.html#/iter_overeager_cloned)
rule and fixes the outstanding violations.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-03-04 12:22:11 -05:00 committed by GitHub
parent 9c6a0d98ed
commit 9ea50ed649
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -614,9 +614,12 @@ impl SyntaxSnapshot {
Some(old_tree.clone()),
);
changed_ranges = join_ranges(
invalidated_ranges.iter().cloned().filter(|range| {
range.start <= step_end_byte && range.end >= step_start_byte
}),
invalidated_ranges
.iter()
.filter(|&range| {
range.start <= step_end_byte && range.end >= step_start_byte
})
.cloned(),
old_tree.changed_ranges(&tree).map(|r| {
step_start_byte + r.start_byte..step_start_byte + r.end_byte
}),

View File

@ -88,7 +88,6 @@ fn run_clippy(args: ClippyArgs) -> Result<()> {
"clippy::derive_ord_xor_partial_ord",
"clippy::eq_op",
"clippy::implied_bounds_in_impls",
"clippy::iter_overeager_cloned",
"clippy::let_underscore_future",
"clippy::map_entry",
"clippy::never_loop",