changeset 52112:71044315a536 stable

rust: address 'error: unnecessarily eager cloning of iterator items' Build failed with a reference to https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned which seems reasonable. There doesn't seem to be any reason to not follow the advice.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 11 Jan 2024 20:37:34 +0100
parents 747a1370c598
children b2e90465daf6 5ad5f0853a0a
files rust/hg-core/src/matchers.rs
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/matchers.rs	Mon Jul 22 18:20:03 2024 +0200
+++ b/rust/hg-core/src/matchers.rs	Thu Jan 11 20:37:34 2024 +0100
@@ -617,7 +617,7 @@
                 std::mem::swap(&mut m1, &mut m2);
             }
             m1.file_set().map(|m1_files| {
-                m1_files.iter().cloned().filter(|f| m2.matches(f)).collect()
+                m1_files.iter().filter(|f| m2.matches(f)).cloned().collect()
             })
         } else {
             // without exact input file sets, we can't do an exact
@@ -710,7 +710,7 @@
         };
         if base_is_exact {
             new.files = base_files.map(|files| {
-                files.iter().cloned().filter(|f| new.matches(f)).collect()
+                files.iter().filter(|f| new.matches(f)).cloned().collect()
             });
         }
         new