@@ -6,7 +6,7 @@ use std::cell::Cell;
66
77/// A dynamic set of regular expressions.
88#[ derive( Clone , Debug , Default ) ]
9- pub struct RegexSet {
9+ pub ( crate ) struct RegexSet {
1010 items : Vec < Box < str > > ,
1111 /// Whether any of the items in the set was ever matched. The length of this
1212 /// vector is exactly the length of `items`.
@@ -17,18 +17,13 @@ pub struct RegexSet {
1717}
1818
1919impl RegexSet {
20- /// Create a new RegexSet
21- pub fn new ( ) -> RegexSet {
22- RegexSet :: default ( )
23- }
24-
2520 /// Is this set empty?
26- pub fn is_empty ( & self ) -> bool {
21+ pub ( crate ) fn is_empty ( & self ) -> bool {
2722 self . items . is_empty ( )
2823 }
2924
3025 /// Insert a new regex into this set.
31- pub fn insert < S > ( & mut self , string : S )
26+ pub ( crate ) fn insert < S > ( & mut self , string : S )
3227 where
3328 S : AsRef < str > ,
3429 {
@@ -38,13 +33,13 @@ impl RegexSet {
3833 }
3934
4035 /// Returns slice of String from its field 'items'
41- pub fn get_items ( & self ) -> & [ Box < str > ] {
36+ pub ( crate ) fn get_items ( & self ) -> & [ Box < str > ] {
4237 & self . items
4338 }
4439
4540 /// Returns an iterator over regexes in the set which didn't match any
4641 /// strings yet.
47- pub fn unmatched_items ( & self ) -> impl Iterator < Item = & str > {
42+ pub ( crate ) fn unmatched_items ( & self ) -> impl Iterator < Item = & str > {
4843 self . items . iter ( ) . enumerate ( ) . filter_map ( move |( i, item) | {
4944 if !self . record_matches || self . matched [ i] . get ( ) {
5045 return None ;
@@ -59,7 +54,8 @@ impl RegexSet {
5954 /// Must be called before calling `matches()`, or it will always return
6055 /// false.
6156 #[ inline]
62- pub fn build ( & mut self , record_matches : bool ) {
57+ #[ allow( unused) ]
58+ pub ( crate ) fn build ( & mut self , record_matches : bool ) {
6359 self . build_inner ( record_matches, None )
6460 }
6561
@@ -70,7 +66,7 @@ impl RegexSet {
7066 /// Must be called before calling `matches()`, or it will always return
7167 /// false.
7268 #[ inline]
73- pub fn build_with_diagnostics (
69+ pub ( crate ) fn build_with_diagnostics (
7470 & mut self ,
7571 record_matches : bool ,
7672 name : Option < & ' static str > ,
@@ -114,7 +110,7 @@ impl RegexSet {
114110 }
115111
116112 /// Does the given `string` match any of the regexes in this set?
117- pub fn matches < S > ( & self , string : S ) -> bool
113+ pub ( crate ) fn matches < S > ( & self , string : S ) -> bool
118114 where
119115 S : AsRef < str > ,
120116 {
0 commit comments