@@ -103,12 +103,12 @@ or to enable case insensitive matching.
103
103
104
104
#![ deny( missing_docs) ]
105
105
106
- extern crate aho_corasick ;
107
- extern crate bstr ;
108
- extern crate fnv;
106
+
107
+
108
+ use fnv;
109
109
#[ macro_use]
110
110
extern crate log;
111
- extern crate regex;
111
+ use regex;
112
112
113
113
#[ cfg( feature = "serde1" ) ]
114
114
extern crate serde;
@@ -228,7 +228,7 @@ impl ErrorKind {
228
228
}
229
229
230
230
impl fmt:: Display for Error {
231
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
231
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
232
232
match self . glob {
233
233
None => self . kind . fmt ( f) ,
234
234
Some ( ref glob) => {
@@ -239,7 +239,7 @@ impl fmt::Display for Error {
239
239
}
240
240
241
241
impl fmt:: Display for ErrorKind {
242
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
242
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
243
243
match * self {
244
244
ErrorKind :: InvalidRecursive
245
245
| ErrorKind :: UnclosedClass
@@ -317,7 +317,7 @@ impl GlobSet {
317
317
///
318
318
/// This takes a Candidate as input, which can be used to amortize the
319
319
/// cost of preparing a path for matching.
320
- pub fn is_match_candidate ( & self , path : & Candidate ) -> bool {
320
+ pub fn is_match_candidate ( & self , path : & Candidate < ' _ > ) -> bool {
321
321
if self . is_empty ( ) {
322
322
return false ;
323
323
}
@@ -340,7 +340,7 @@ impl GlobSet {
340
340
///
341
341
/// This takes a Candidate as input, which can be used to amortize the
342
342
/// cost of preparing a path for matching.
343
- pub fn matches_candidate ( & self , path : & Candidate ) -> Vec < usize > {
343
+ pub fn matches_candidate ( & self , path : & Candidate < ' _ > ) -> Vec < usize > {
344
344
let mut into = vec ! [ ] ;
345
345
if self . is_empty ( ) {
346
346
return into;
@@ -374,7 +374,7 @@ impl GlobSet {
374
374
/// cost of preparing a path for matching.
375
375
pub fn matches_candidate_into (
376
376
& self ,
377
- path : & Candidate ,
377
+ path : & Candidate < ' _ > ,
378
378
into : & mut Vec < usize > ,
379
379
) {
380
380
into. clear ( ) ;
@@ -543,7 +543,7 @@ enum GlobSetMatchStrategy {
543
543
}
544
544
545
545
impl GlobSetMatchStrategy {
546
- fn is_match ( & self , candidate : & Candidate ) -> bool {
546
+ fn is_match ( & self , candidate : & Candidate < ' _ > ) -> bool {
547
547
use self :: GlobSetMatchStrategy :: * ;
548
548
match * self {
549
549
Literal ( ref s) => s. is_match ( candidate) ,
@@ -556,7 +556,7 @@ impl GlobSetMatchStrategy {
556
556
}
557
557
}
558
558
559
- fn matches_into ( & self , candidate : & Candidate , matches : & mut Vec < usize > ) {
559
+ fn matches_into ( & self , candidate : & Candidate < ' _ > , matches : & mut Vec < usize > ) {
560
560
use self :: GlobSetMatchStrategy :: * ;
561
561
match * self {
562
562
Literal ( ref s) => s. matches_into ( candidate, matches) ,
@@ -582,12 +582,12 @@ impl LiteralStrategy {
582
582
self . 0 . entry ( lit. into_bytes ( ) ) . or_insert ( vec ! [ ] ) . push ( global_index) ;
583
583
}
584
584
585
- fn is_match ( & self , candidate : & Candidate ) -> bool {
585
+ fn is_match ( & self , candidate : & Candidate < ' _ > ) -> bool {
586
586
self . 0 . contains_key ( candidate. path . as_bytes ( ) )
587
587
}
588
588
589
589
#[ inline( never) ]
590
- fn matches_into ( & self , candidate : & Candidate , matches : & mut Vec < usize > ) {
590
+ fn matches_into ( & self , candidate : & Candidate < ' _ > , matches : & mut Vec < usize > ) {
591
591
if let Some ( hits) = self . 0 . get ( candidate. path . as_bytes ( ) ) {
592
592
matches. extend ( hits) ;
593
593
}
@@ -606,15 +606,15 @@ impl BasenameLiteralStrategy {
606
606
self . 0 . entry ( lit. into_bytes ( ) ) . or_insert ( vec ! [ ] ) . push ( global_index) ;
607
607
}
608
608
609
- fn is_match ( & self , candidate : & Candidate ) -> bool {
609
+ fn is_match ( & self , candidate : & Candidate < ' _ > ) -> bool {
610
610
if candidate. basename . is_empty ( ) {
611
611
return false ;
612
612
}
613
613
self . 0 . contains_key ( candidate. basename . as_bytes ( ) )
614
614
}
615
615
616
616
#[ inline( never) ]
617
- fn matches_into ( & self , candidate : & Candidate , matches : & mut Vec < usize > ) {
617
+ fn matches_into ( & self , candidate : & Candidate < ' _ > , matches : & mut Vec < usize > ) {
618
618
if candidate. basename . is_empty ( ) {
619
619
return ;
620
620
}
@@ -636,15 +636,15 @@ impl ExtensionStrategy {
636
636
self . 0 . entry ( ext. into_bytes ( ) ) . or_insert ( vec ! [ ] ) . push ( global_index) ;
637
637
}
638
638
639
- fn is_match ( & self , candidate : & Candidate ) -> bool {
639
+ fn is_match ( & self , candidate : & Candidate < ' _ > ) -> bool {
640
640
if candidate. ext . is_empty ( ) {
641
641
return false ;
642
642
}
643
643
self . 0 . contains_key ( candidate. ext . as_bytes ( ) )
644
644
}
645
645
646
646
#[ inline( never) ]
647
- fn matches_into ( & self , candidate : & Candidate , matches : & mut Vec < usize > ) {
647
+ fn matches_into ( & self , candidate : & Candidate < ' _ > , matches : & mut Vec < usize > ) {
648
648
if candidate. ext . is_empty ( ) {
649
649
return ;
650
650
}
@@ -662,7 +662,7 @@ struct PrefixStrategy {
662
662
}
663
663
664
664
impl PrefixStrategy {
665
- fn is_match ( & self , candidate : & Candidate ) -> bool {
665
+ fn is_match ( & self , candidate : & Candidate < ' _ > ) -> bool {
666
666
let path = candidate. path_prefix ( self . longest ) ;
667
667
for m in self . matcher . find_overlapping_iter ( path) {
668
668
if m. start ( ) == 0 {
@@ -672,7 +672,7 @@ impl PrefixStrategy {
672
672
false
673
673
}
674
674
675
- fn matches_into ( & self , candidate : & Candidate , matches : & mut Vec < usize > ) {
675
+ fn matches_into ( & self , candidate : & Candidate < ' _ > , matches : & mut Vec < usize > ) {
676
676
let path = candidate. path_prefix ( self . longest ) ;
677
677
for m in self . matcher . find_overlapping_iter ( path) {
678
678
if m. start ( ) == 0 {
@@ -690,7 +690,7 @@ struct SuffixStrategy {
690
690
}
691
691
692
692
impl SuffixStrategy {
693
- fn is_match ( & self , candidate : & Candidate ) -> bool {
693
+ fn is_match ( & self , candidate : & Candidate < ' _ > ) -> bool {
694
694
let path = candidate. path_suffix ( self . longest ) ;
695
695
for m in self . matcher . find_overlapping_iter ( path) {
696
696
if m. end ( ) == path. len ( ) {
@@ -700,7 +700,7 @@ impl SuffixStrategy {
700
700
false
701
701
}
702
702
703
- fn matches_into ( & self , candidate : & Candidate , matches : & mut Vec < usize > ) {
703
+ fn matches_into ( & self , candidate : & Candidate < ' _ > , matches : & mut Vec < usize > ) {
704
704
let path = candidate. path_suffix ( self . longest ) ;
705
705
for m in self . matcher . find_overlapping_iter ( path) {
706
706
if m. end ( ) == path. len ( ) {
@@ -714,7 +714,7 @@ impl SuffixStrategy {
714
714
struct RequiredExtensionStrategy ( HashMap < Vec < u8 > , Vec < ( usize , Regex ) > , Fnv > ) ;
715
715
716
716
impl RequiredExtensionStrategy {
717
- fn is_match ( & self , candidate : & Candidate ) -> bool {
717
+ fn is_match ( & self , candidate : & Candidate < ' _ > ) -> bool {
718
718
if candidate. ext . is_empty ( ) {
719
719
return false ;
720
720
}
@@ -732,7 +732,7 @@ impl RequiredExtensionStrategy {
732
732
}
733
733
734
734
#[ inline( never) ]
735
- fn matches_into ( & self , candidate : & Candidate , matches : & mut Vec < usize > ) {
735
+ fn matches_into ( & self , candidate : & Candidate < ' _ > , matches : & mut Vec < usize > ) {
736
736
if candidate. ext . is_empty ( ) {
737
737
return ;
738
738
}
@@ -753,11 +753,11 @@ struct RegexSetStrategy {
753
753
}
754
754
755
755
impl RegexSetStrategy {
756
- fn is_match ( & self , candidate : & Candidate ) -> bool {
756
+ fn is_match ( & self , candidate : & Candidate < ' _ > ) -> bool {
757
757
self . matcher . is_match ( candidate. path . as_bytes ( ) )
758
758
}
759
759
760
- fn matches_into ( & self , candidate : & Candidate , matches : & mut Vec < usize > ) {
760
+ fn matches_into ( & self , candidate : & Candidate < ' _ > , matches : & mut Vec < usize > ) {
761
761
for i in self . matcher . matches ( candidate. path . as_bytes ( ) ) {
762
762
matches. push ( self . map [ i] ) ;
763
763
}
0 commit comments