@@ -108,11 +108,7 @@ pub enum Err<E> {
108
108
impl < E > Err < E > {
109
109
/// Tests if the result is Incomplete
110
110
pub fn is_incomplete ( & self ) -> bool {
111
- if let Err :: Incomplete ( _) = self {
112
- true
113
- } else {
114
- false
115
- }
111
+ matches ! ( self , Err :: Incomplete ( _) )
116
112
}
117
113
118
114
/// Applies the given function to the inner error
@@ -344,7 +340,7 @@ pub struct Map<F, G, O1> {
344
340
phantom : core:: marker:: PhantomData < O1 > ,
345
341
}
346
342
347
- impl < ' a , I , O1 , O2 , E , F : Parser < I , O1 , E > , G : Fn ( O1 ) -> O2 > Parser < I , O2 , E > for Map < F , G , O1 > {
343
+ impl < I , O1 , O2 , E , F : Parser < I , O1 , E > , G : Fn ( O1 ) -> O2 > Parser < I , O2 , E > for Map < F , G , O1 > {
348
344
fn parse ( & mut self , i : I ) -> IResult < I , O2 , E > {
349
345
match self . f . parse ( i) {
350
346
Err ( e) => Err ( e) ,
@@ -361,7 +357,7 @@ pub struct FlatMap<F, G, O1> {
361
357
phantom : core:: marker:: PhantomData < O1 > ,
362
358
}
363
359
364
- impl < ' a , I , O1 , O2 , E , F : Parser < I , O1 , E > , G : Fn ( O1 ) -> H , H : Parser < I , O2 , E > > Parser < I , O2 , E >
360
+ impl < I , O1 , O2 , E , F : Parser < I , O1 , E > , G : Fn ( O1 ) -> H , H : Parser < I , O2 , E > > Parser < I , O2 , E >
365
361
for FlatMap < F , G , O1 >
366
362
{
367
363
fn parse ( & mut self , i : I ) -> IResult < I , O2 , E > {
@@ -378,7 +374,7 @@ pub struct AndThen<F, G, O1> {
378
374
phantom : core:: marker:: PhantomData < O1 > ,
379
375
}
380
376
381
- impl < ' a , I , O1 , O2 , E , F : Parser < I , O1 , E > , G : Parser < O1 , O2 , E > > Parser < I , O2 , E >
377
+ impl < I , O1 , O2 , E , F : Parser < I , O1 , E > , G : Parser < O1 , O2 , E > > Parser < I , O2 , E >
382
378
for AndThen < F , G , O1 >
383
379
{
384
380
fn parse ( & mut self , i : I ) -> IResult < I , O2 , E > {
@@ -395,9 +391,7 @@ pub struct And<F, G> {
395
391
g : G ,
396
392
}
397
393
398
- impl < ' a , I , O1 , O2 , E , F : Parser < I , O1 , E > , G : Parser < I , O2 , E > > Parser < I , ( O1 , O2 ) , E >
399
- for And < F , G >
400
- {
394
+ impl < I , O1 , O2 , E , F : Parser < I , O1 , E > , G : Parser < I , O2 , E > > Parser < I , ( O1 , O2 ) , E > for And < F , G > {
401
395
fn parse ( & mut self , i : I ) -> IResult < I , ( O1 , O2 ) , E > {
402
396
let ( i, o1) = self . f . parse ( i) ?;
403
397
let ( i, o2) = self . g . parse ( i) ?;
@@ -412,8 +406,8 @@ pub struct Or<F, G> {
412
406
g : G ,
413
407
}
414
408
415
- impl < ' a , I : Clone , O , E : crate :: error:: ParseError < I > , F : Parser < I , O , E > , G : Parser < I , O , E > >
416
- Parser < I , O , E > for Or < F , G >
409
+ impl < I : Clone , O , E : error:: ParseError < I > , F : Parser < I , O , E > , G : Parser < I , O , E > > Parser < I , O , E >
410
+ for Or < F , G >
417
411
{
418
412
fn parse ( & mut self , i : I ) -> IResult < I , O , E > {
419
413
match self . f . parse ( i. clone ( ) ) {
@@ -436,15 +430,8 @@ pub struct Into<F, O1, O2: From<O1>, E1, E2: From<E1>> {
436
430
phantom_err2 : core:: marker:: PhantomData < E2 > ,
437
431
}
438
432
439
- impl <
440
- ' a ,
441
- I : Clone ,
442
- O1 ,
443
- O2 : From < O1 > ,
444
- E1 ,
445
- E2 : crate :: error:: ParseError < I > + From < E1 > ,
446
- F : Parser < I , O1 , E1 > ,
447
- > Parser < I , O2 , E2 > for Into < F , O1 , O2 , E1 , E2 >
433
+ impl < I : Clone , O1 , O2 : From < O1 > , E1 , E2 : error:: ParseError < I > + From < E1 > , F : Parser < I , O1 , E1 > >
434
+ Parser < I , O2 , E2 > for Into < F , O1 , O2 , E1 , E2 >
448
435
{
449
436
fn parse ( & mut self , i : I ) -> IResult < I , O2 , E2 > {
450
437
match self . f . parse ( i) {
0 commit comments