File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
regex-automata/src/util/determinize Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ pub(crate) struct State(Arc<[u8]>);
115
115
/// without having to convert it into a State first.
116
116
impl core:: borrow:: Borrow < [ u8 ] > for State {
117
117
fn borrow ( & self ) -> & [ u8 ] {
118
- & * self . 0
118
+ & self . 0
119
119
}
120
120
}
121
121
@@ -177,7 +177,7 @@ impl State {
177
177
}
178
178
179
179
fn repr ( & self ) -> Repr < ' _ > {
180
- Repr ( & * self . 0 )
180
+ Repr ( & self . 0 )
181
181
}
182
182
}
183
183
@@ -460,12 +460,10 @@ impl<'a> Repr<'a> {
460
460
///
461
461
/// If this state is not a match state, then this always returns 0.
462
462
fn match_len ( & self ) -> usize {
463
- if !self . is_match ( ) {
464
- return 0 ;
465
- } else if !self . has_pattern_ids ( ) {
466
- 1
467
- } else {
468
- self . encoded_pattern_len ( )
463
+ match ( self . is_match ( ) , self . has_pattern_ids ( ) ) {
464
+ ( false , _) => 0 ,
465
+ ( true , false ) => 1 ,
466
+ ( true , true ) => self . encoded_pattern_len ( ) ,
469
467
}
470
468
}
471
469
You can’t perform that action at this time.
0 commit comments