Upgrade rust/crates/regex to 1.4.1
Test: make
Change-Id: Ie12506e8c765f9dd8043cd61b0c77bebd887302e
diff --git a/src/re_set.rs b/src/re_set.rs
index fc2b61a..b8954be 100644
--- a/src/re_set.rs
+++ b/src/re_set.rs
@@ -96,6 +96,19 @@
RegexSetBuilder::new(exprs).build()
}
+ /// Create a new empty regex set.
+ ///
+ /// # Example
+ ///
+ /// ```rust
+ /// # use regex::RegexSet;
+ /// let set = RegexSet::empty();
+ /// assert!(set.is_empty());
+ /// ```
+ pub fn empty() -> RegexSet {
+ RegexSetBuilder::new(&[""; 0]).build().unwrap()
+ }
+
/// Returns true if and only if one of the regexes in this set matches
/// the text given.
///
@@ -207,6 +220,11 @@
self.0.regex_strings().len()
}
+ /// Returns `true` if this set contains no regular expressions.
+ pub fn is_empty(&self) -> bool {
+ self.0.regex_strings().is_empty()
+ }
+
/// Returns the patterns that this set will match on.
///
/// This function can be used to determine the pattern for a match. The