rust-files: add a `Sync` bound to the matcher
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 30 Sep 2024 19:12:42 +0200
changeset 52039 b8b3984deae3
parent 52038 b7d99348ea36
child 52040 7c105b953ca4
rust-files: add a `Sync` bound to the matcher This enables us to use this code in multithreaded environements, which we very much want to do.
rust/hg-core/src/operations/list_tracked_files.rs
--- a/rust/hg-core/src/operations/list_tracked_files.rs	Mon Sep 30 12:10:35 2024 +0200
+++ b/rust/hg-core/src/operations/list_tracked_files.rs	Mon Sep 30 19:12:42 2024 +0200
@@ -20,7 +20,7 @@
 pub fn list_rev_tracked_files(
     repo: &Repo,
     revset: &str,
-    narrow_matcher: Box<dyn Matcher>,
+    narrow_matcher: Box<dyn Matcher + Sync>,
 ) -> Result<FilesForRev, RevlogError> {
     let rev = crate::revset::resolve_single(revset, repo)?;
     Ok(FilesForRev {
@@ -31,7 +31,7 @@
 
 pub struct FilesForRev {
     manifest: Manifest,
-    narrow_matcher: Box<dyn Matcher>,
+    narrow_matcher: Box<dyn Matcher + Sync>,
 }
 
 /// Like [`crate::revlog::manifest::ManifestEntry`], but with the `Node`