diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-02-03 10:03:23 -0800 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-02-03 10:03:23 -0800 |
commit | 58b3ed1279674dd9ed7eda72b174f2ca1a7fc530 (patch) | |
tree | bdd4341128c3b68c836c5ea8047daa52d33e7a6a /src/regex_set.rs | |
parent | 4c45407aba15f81bc5fb19650bb8c14e51548519 (diff) |
Run `cargo fmt`
Diffstat (limited to 'src/regex_set.rs')
-rw-r--r-- | src/regex_set.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/regex_set.rs b/src/regex_set.rs index dbdb6565..2eff740b 100644 --- a/src/regex_set.rs +++ b/src/regex_set.rs @@ -21,7 +21,7 @@ impl RegexSet { /// Extend this set with every regex in the iterator. pub fn extend<I, S>(&mut self, iter: I) where I: IntoIterator<Item = S>, - S: AsRef<str> + S: AsRef<str>, { for s in iter.into_iter() { self.insert(s) @@ -30,7 +30,7 @@ impl RegexSet { /// Insert a new regex into this set. pub fn insert<S>(&mut self, string: S) - where S: AsRef<str> + where S: AsRef<str>, { self.items.push(format!("^{}$", string.as_ref())); self.set = None; @@ -46,13 +46,13 @@ impl RegexSet { Err(e) => { error!("Invalid regex in {:?}: {:?}", self.items, e); None - }, + } } } /// Does the given `string` match any of the regexes in this set? pub fn matches<S>(&self, string: S) -> bool - where S: AsRef<str> + where S: AsRef<str>, { let s = string.as_ref(); self.set.as_ref().map(|set| set.is_match(s)).unwrap_or(false) |