globset: add GlobMatcher::glob

This exposes the underlying `Glob` used to compile the matcher. This can
be useful for wrapping up the glob matcher in other types.

Closes #1454
This commit is contained in:
Lucien Greathouse 2020-01-03 15:36:29 -08:00 committed by Andrew Gallant
parent cd8ec38a68
commit 2263b8ac92

View File

@ -122,6 +122,11 @@ impl GlobMatcher {
pub fn is_match_candidate(&self, path: &Candidate) -> bool {
self.re.is_match(&path.path)
}
/// Returns the `Glob` used to compile this matcher.
pub fn glob(&self) -> &Glob {
&self.pat
}
}
/// A strategic matcher for a single pattern.