@@ -20,12 +20,12 @@ pub fn sq_dequote_step<'i>(input: &mut &'i str) -> Result<Cow<'i, str>, QuoteErr
20
20
sq_dequote. parse_next ( input) . map_err ( |_e| QuoteError )
21
21
}
22
22
23
- pub fn sq_dequote < ' i > ( input : & mut & ' i str ) -> PResult < Cow < ' i , str > , ( ) > {
23
+ pub fn sq_dequote < ' i > ( input : & mut & ' i str ) -> ModalResult < Cow < ' i , str > , ( ) > {
24
24
// See git's quote.c's `sq_dequote_step`
25
25
alt ( ( sq_dequote_escaped, sq_dequote_no_escaped) ) . parse_next ( input)
26
26
}
27
27
28
- fn sq_dequote_escaped < ' i > ( input : & mut & ' i str ) -> PResult < Cow < ' i , str > , ( ) > {
28
+ fn sq_dequote_escaped < ' i > ( input : & mut & ' i str ) -> ModalResult < Cow < ' i , str > , ( ) > {
29
29
(
30
30
sq_dequote_section,
31
31
sq_dequote_trail,
@@ -40,22 +40,22 @@ fn sq_dequote_escaped<'i>(input: &mut &'i str) -> PResult<Cow<'i, str>, ()> {
40
40
. parse_next ( input)
41
41
}
42
42
43
- fn sq_dequote_no_escaped < ' i > ( input : & mut & ' i str ) -> PResult < Cow < ' i , str > , ( ) > {
43
+ fn sq_dequote_no_escaped < ' i > ( input : & mut & ' i str ) -> ModalResult < Cow < ' i , str > , ( ) > {
44
44
sq_dequote_section. map ( Cow :: Borrowed ) . parse_next ( input)
45
45
}
46
46
47
- fn sq_dequote_section < ' i > ( input : & mut & ' i str ) -> PResult < & ' i str , ( ) > {
47
+ fn sq_dequote_section < ' i > ( input : & mut & ' i str ) -> ModalResult < & ' i str , ( ) > {
48
48
terminated ( preceded ( '\'' , take_while ( 0 .., |c| c != '\'' ) ) , '\'' ) . parse_next ( input)
49
49
}
50
50
51
- fn sq_dequote_trail < ' i > ( input : & mut & ' i str ) -> PResult < [ & ' i str ; 2 ] , ( ) > {
51
+ fn sq_dequote_trail < ' i > ( input : & mut & ' i str ) -> ModalResult < [ & ' i str ; 2 ] , ( ) > {
52
52
( escaped, sq_dequote_section)
53
53
. map ( |( e, s) | [ e, s] )
54
54
. parse_next ( input)
55
55
}
56
56
57
- fn escaped < ' i > ( input : & mut & ' i str ) -> PResult < & ' i str , ( ) > {
58
- preceded ( '\\' , one_of ( [ '\'' , '!' ] ) . recognize ( ) ) . parse_next ( input)
57
+ fn escaped < ' i > ( input : & mut & ' i str ) -> ModalResult < & ' i str , ( ) > {
58
+ preceded ( '\\' , one_of ( [ '\'' , '!' ] ) . take ( ) ) . parse_next ( input)
59
59
}
60
60
61
61
#[ cfg( test) ]
0 commit comments