From be0bed40e57c6009f67f6217485ee499fb9c4eca Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 16 Oct 2023 23:55:49 +0200 Subject: [PATCH] Add GlobSet::builder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … as a likely more convenient version of GlobSetBuilder::new. --- crates/globset/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/globset/src/lib.rs b/crates/globset/src/lib.rs index 83159e6ac..b1fc696af 100644 --- a/crates/globset/src/lib.rs +++ b/crates/globset/src/lib.rs @@ -304,6 +304,14 @@ pub struct GlobSet { } impl GlobSet { + /// Create a new [`GlobSetBuilder`]. A `GlobSetBuilder` can be used to add + /// new patterns. Once all patterns have been added, `build` should be + /// called to produce a `GlobSet`, which can then be used for matching. + #[inline] + pub fn builder() -> GlobSetBuilder { + GlobSetBuilder::new() + } + /// Create an empty `GlobSet`. An empty set matches nothing. #[inline] pub fn empty() -> GlobSet {