summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucien Greathouse <me@lpghatguy.com>2020-01-03 15:36:29 -0800
committerAndrew Gallant <jamslam@gmail.com>2020-02-17 17:16:28 -0500
commit2263b8ac9293073dbf7bf29691889ade53042650 (patch)
treefef4cd0bf1c2d4d7c1f601d6142361bc9006fa31
parentcd8ec38a68b28d6ce2f7821d80fbeb37fe0cf7ac (diff)
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
-rw-r--r--globset/src/glob.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/globset/src/glob.rs b/globset/src/glob.rs
index eccfb2d3..e327d998 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.