Skip to content

Commit

Permalink
Add GlobSet::builder
Browse files Browse the repository at this point in the history
… as a likely more convenient version of GlobSetBuilder::new.
  • Loading branch information
jplatte committed Oct 16, 2023
1 parent b93d30d commit be0bed4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/globset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit be0bed4

Please sign in to comment.