> +pub trait Matcher {
> +    /// Explicitly listed files
> +    fn file_set(&self) -> HashSet<&HgPath>;

[...]
> +    /// Matcher will match everything and `files_set()` will be empty:
> +    /// optimization might be possible.
> +    fn matches_everything(&self) -> bool {
> +        false
> +    }

Maybe better to not provide the default implementations since not a few
matchers will have to reimplement them.

> +impl Matcher for AlwaysMatcher {
> +    fn file_set(&self) -> HashSet<&HgPath> {
> +        HashSet::new()
> +    }
> +
> +    fn visit_children_set(
> +        &self,
> +        _directory: impl AsRef<HgPath>,
> +    ) -> VisitChildrenSet {
> +        VisitChildrenSet::Recursive
> +    }

Need to implement `matches()` and `matches_everything()`?
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to