@@ -85,7 +85,7 @@ pub struct Parser<'a> {
85
85
pending_single_byte : bool ,
86
86
}
87
87
88
- impl < ' a > Parser < ' a > {
88
+ impl Parser < ' _ > {
89
89
/// Creates a new iterator which parse the data into segments that only
90
90
/// contains their exclusive subsets. No optimization is done at this point.
91
91
///
@@ -103,7 +103,7 @@ impl<'a> Parser<'a> {
103
103
/// ]
104
104
/// );
105
105
/// ```
106
- pub fn new ( data : & [ u8 ] ) -> Parser {
106
+ pub fn new ( data : & [ u8 ] ) -> Parser < ' _ > {
107
107
Parser {
108
108
ecs_iter : EcsIter { base : data. iter ( ) , index : 0 , ended : false } ,
109
109
state : State :: Init ,
@@ -113,7 +113,7 @@ impl<'a> Parser<'a> {
113
113
}
114
114
}
115
115
116
- impl < ' a > Iterator for Parser < ' a > {
116
+ impl Iterator for Parser < ' _ > {
117
117
type Item = Segment ;
118
118
119
119
fn next ( & mut self ) -> Option < Segment > {
@@ -124,10 +124,7 @@ impl<'a> Iterator for Parser<'a> {
124
124
}
125
125
126
126
loop {
127
- let ( i, ecs) = match self . ecs_iter . next ( ) {
128
- None => return None ,
129
- Some ( a) => a,
130
- } ;
127
+ let ( i, ecs) = self . ecs_iter . next ( ) ?;
131
128
let ( next_state, action) = STATE_TRANSITION [ self . state as usize + ecs as usize ] ;
132
129
self . state = next_state;
133
130
@@ -289,7 +286,7 @@ impl<I: Iterator<Item = Segment>> Optimizer<I> {
289
286
}
290
287
}
291
288
292
- impl < ' a > Parser < ' a > {
289
+ impl Parser < ' _ > {
293
290
pub fn optimize ( self , version : Version ) -> Optimizer < Self > {
294
291
Optimizer :: new ( self , version)
295
292
}
0 commit comments