From 2263b8ac9293073dbf7bf29691889ade53042650 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Fri, 3 Jan 2020 15:36:29 -0800 Subject: [PATCH] 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 --- globset/src/glob.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/globset/src/glob.rs b/globset/src/glob.rs index eccfb2d..e327d99 100644 --- a/globset/src/glob.rs +++ b/globset/src/glob.rs @@ -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.