diff rust/hg-core/src/lib.rs @ 43438:a77d4fe347a4

rust-matchers: add `Matcher` trait and implement `AlwaysMatcher` In our quest of a faster Mercurial, we have arrived at the point where we need to implement the matchers in Rust. This RFC mainly for the `Matcher` trait to see if the changes proposed feel fine to people with more experience on the matter. While the `AlwaysMatcher` implementation is here as a trivial example, it should be the first step towards matchers use in Rust as it is currently the only supported one. Notable changes: - `exact` is renamed to `exact_match` - enums for `visit*` methods with `Recursive` instead of `'all'`, etc. - a new `roots`, separate from `file_set` - no `bad`, `explicitdir` or `traversedir` functions as they can be passed to the high functions instead of the matchers Thanks to Martin for suggesting the last two (most important) changes and for reaching out to help a few weeks ago. Differential Revision: https://phab.mercurial-scm.org/D7178
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 29 Oct 2019 17:16:28 +0100
parents 99394e6c5d12
children 1fe2e574616e
line wrap: on
line diff
--- a/rust/hg-core/src/lib.rs	Tue Nov 05 13:19:24 2019 -0800
+++ b/rust/hg-core/src/lib.rs	Tue Oct 29 17:16:28 2019 +0100
@@ -17,6 +17,7 @@
     StateMap, StateMapIter,
 };
 mod filepatterns;
+pub mod matchers;
 pub mod utils;
 
 use crate::utils::hg_path::HgPathBuf;