1
1
use std:: convert:: TryFrom ;
2
2
3
3
use bstr:: ByteSlice ;
4
- use nom :: {
4
+ use winnow :: {
5
5
bytes:: complete:: { tag, take_till, take_till1} ,
6
6
combinator:: { map_res, opt} ,
7
7
sequence:: { preceded, terminated} ,
@@ -73,11 +73,11 @@ impl<'a> RemoteProgress<'a> {
73
73
}
74
74
}
75
75
76
- fn parse_number ( i : & [ u8 ] ) -> nom :: IResult < & [ u8 ] , usize > {
76
+ fn parse_number ( i : & [ u8 ] ) -> winnow :: IResult < & [ u8 ] , usize > {
77
77
map_res ( take_till ( |c : u8 | !c. is_ascii_digit ( ) ) , btoi:: btoi) ( i)
78
78
}
79
79
80
- fn next_optional_percentage ( i : & [ u8 ] ) -> nom :: IResult < & [ u8 ] , Option < u32 > > {
80
+ fn next_optional_percentage ( i : & [ u8 ] ) -> winnow :: IResult < & [ u8 ] , Option < u32 > > {
81
81
opt ( terminated (
82
82
preceded (
83
83
take_till ( |c : u8 | c. is_ascii_digit ( ) ) ,
@@ -87,11 +87,11 @@ fn next_optional_percentage(i: &[u8]) -> nom::IResult<&[u8], Option<u32>> {
87
87
) ) ( i)
88
88
}
89
89
90
- fn next_optional_number ( i : & [ u8 ] ) -> nom :: IResult < & [ u8 ] , Option < usize > > {
90
+ fn next_optional_number ( i : & [ u8 ] ) -> winnow :: IResult < & [ u8 ] , Option < usize > > {
91
91
opt ( preceded ( take_till ( |c : u8 | c. is_ascii_digit ( ) ) , parse_number) ) ( i)
92
92
}
93
93
94
- fn parse_progress ( line : & [ u8 ] ) -> nom :: IResult < & [ u8 ] , RemoteProgress < ' _ > > {
94
+ fn parse_progress ( line : & [ u8 ] ) -> winnow :: IResult < & [ u8 ] , RemoteProgress < ' _ > > {
95
95
let ( i, action) = take_till1 ( |c| c == b':' ) ( line) ?;
96
96
let ( i, percent) = next_optional_percentage ( i) ?;
97
97
let ( i, step) = next_optional_number ( i) ?;
0 commit comments