diff -r ffd4b1f1c9cb -r e8481625c582 rust/hg-core/src/matchers.rs --- a/rust/hg-core/src/matchers.rs Tue Jul 19 15:37:45 2022 +0200 +++ b/rust/hg-core/src/matchers.rs Mon Jul 11 11:59:13 2022 +0200 @@ -46,7 +46,7 @@ Recursive, } -pub trait Matcher { +pub trait Matcher: core::fmt::Debug { /// Explicitly listed files fn file_set(&self) -> Option<&HashSet>; /// Returns whether `filename` is in `file_set` @@ -283,6 +283,18 @@ parents: HashSet, } +impl core::fmt::Debug for IncludeMatcher<'_> { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("IncludeMatcher") + .field("patterns", &String::from_utf8_lossy(&self.patterns)) + .field("prefix", &self.prefix) + .field("roots", &self.roots) + .field("dirs", &self.dirs) + .field("parents", &self.parents) + .finish() + } +} + impl<'a> Matcher for IncludeMatcher<'a> { fn file_set(&self) -> Option<&HashSet> { None @@ -330,6 +342,7 @@ } /// The union of multiple matchers. Will match if any of the matchers match. +#[derive(Debug)] pub struct UnionMatcher { matchers: Vec>, } @@ -393,6 +406,7 @@ } } +#[derive(Debug)] pub struct IntersectionMatcher { m1: Box, m2: Box, @@ -474,6 +488,7 @@ } } +#[derive(Debug)] pub struct DifferenceMatcher { base: Box, excluded: Box,