@@ -47,7 +47,7 @@ fn str_to_digit(bytes: &[u8]) -> u64 {
4747 . unwrap_or_default ( )
4848}
4949
50- fn read_hexadecimal ( input : & [ u8 ] ) -> ParseResult < u64 > {
50+ fn read_hexadecimal ( input : & [ u8 ] ) -> ParseResult < ' _ , u64 > {
5151 preceded ( alt ( ( tag ( b"0x" ) , tag ( b"0X" ) ) ) , take_while1 ( is_hex_digit) ) ( input) . map ( |( b, v) | unsafe {
5252 // We know this is okay because it's just the bytes that pass `is_hex_digit`
5353 (
@@ -63,11 +63,11 @@ fn valid_name_char(character: u8) -> bool {
6363 c. is_ascii ( ) && c != '\n' && c != '\r'
6464}
6565
66- fn strip_whitespace ( s : & [ u8 ] ) -> ParseResult < ( ) > {
66+ fn strip_whitespace ( s : & [ u8 ] ) -> ParseResult < ' _ , ( ) > {
6767 one_of ( & b" \n \r \t " [ ..] ) ( s) . map ( |( b, _) | ( b, ( ) ) )
6868}
6969
70- fn strip_comments ( s : & [ u8 ] ) -> ParseResult < ( ) > {
70+ fn strip_comments ( s : & [ u8 ] ) -> ParseResult < ' _ , ( ) > {
7171 delimited (
7272 tag ( b"#" ) ,
7373 alt ( ( take_until ( "\r " ) , take_until ( "\n " ) ) ) ,
@@ -76,11 +76,11 @@ fn strip_comments(s: &[u8]) -> ParseResult<()> {
7676 . map ( |( b, _) | ( b, ( ) ) )
7777}
7878
79- fn skip_to_content ( s : & [ u8 ] ) -> ParseResult < ( ) > {
79+ fn skip_to_content ( s : & [ u8 ] ) -> ParseResult < ' _ , ( ) > {
8080 many0 ( alt ( ( strip_whitespace, strip_comments) ) ) ( s) . map ( |( b, _) | ( b, ( ) ) )
8181}
8282
83- fn match_header_tags ( s : & [ u8 ] ) -> ParseResult < & [ u8 ] > {
83+ fn match_header_tags ( s : & [ u8 ] ) -> ParseResult < ' _ , & [ u8 ] > {
8484 alt ( (
8585 tag_no_case ( IR_TAG ) ,
8686 tag_no_case ( FE_TAG ) ,
@@ -91,33 +91,33 @@ fn match_header_tags(s: &[u8]) -> ParseResult<&[u8]> {
9191 ) ) ( s)
9292}
9393
94- fn parse_header_tags ( s : & [ u8 ] ) -> ParseResult < Vec < & [ u8 ] > > {
94+ fn parse_header_tags ( s : & [ u8 ] ) -> ParseResult < ' _ , Vec < & [ u8 ] > > {
9595 many0 ( delimited ( tag ( b":" ) , match_header_tags, line_ending) ) ( s)
9696}
9797
98- fn read_line ( s : & [ u8 ] ) -> ParseResult < & [ u8 ] > {
98+ fn read_line ( s : & [ u8 ] ) -> ParseResult < ' _ , & [ u8 ] > {
9999 tuple ( ( take_while1 ( valid_name_char) , line_ending) ) ( s) . map ( |( b, ( v, _) ) | ( b, v) )
100100}
101101
102- fn read_decimal ( s : & [ u8 ] ) -> ParseResult < u64 > {
102+ fn read_decimal ( s : & [ u8 ] ) -> ParseResult < ' _ , u64 > {
103103 tuple ( ( take_while1 ( is_digit) , alt ( ( line_ending, eof) ) ) ) ( s) . map ( |( b, v) | ( b, str_to_digit ( v. 0 ) ) )
104104}
105105
106- fn read_digit ( s : & [ u8 ] ) -> ParseResult < u64 > {
106+ fn read_digit ( s : & [ u8 ] ) -> ParseResult < ' _ , u64 > {
107107 alt ( ( read_decimal, read_hexadecimal) ) ( s)
108108}
109109
110- fn indirect_value_site ( s : & [ u8 ] ) -> ParseResult < ( & [ u8 ] , u64 ) > {
110+ fn indirect_value_site ( s : & [ u8 ] ) -> ParseResult < ' _ , ( & [ u8 ] , u64 ) > {
111111 tuple ( ( take_until ( ":" ) , tag ( ":" ) , take_while1 ( is_digit) ) ) ( s)
112112 . map ( |( b, v) | ( b, ( v. 0 , str_to_digit ( v. 2 ) ) ) )
113113}
114114
115- fn memop_value_site ( s : & [ u8 ] ) -> ParseResult < ( u64 , u64 ) > {
115+ fn memop_value_site ( s : & [ u8 ] ) -> ParseResult < ' _ , ( u64 , u64 ) > {
116116 tuple ( ( take_while1 ( is_digit) , tag ( ":" ) , take_while1 ( is_digit) ) ) ( s)
117117 . map ( |( b, v) | ( b, ( str_to_digit ( v. 0 ) , str_to_digit ( v. 2 ) ) ) )
118118}
119119
120- fn read_value_profile_data ( mut input : & [ u8 ] ) -> ParseResult < Option < Box < ValueProfDataRecord > > > {
120+ fn read_value_profile_data ( mut input : & [ u8 ] ) -> ParseResult < ' _ , Option < Box < ValueProfDataRecord > > > {
121121 if let Ok ( ( bytes, n_kinds) ) = read_digit ( input) {
122122 let mut record = Box :: < ValueProfDataRecord > :: default ( ) ;
123123 // We have value profiling data!
@@ -190,7 +190,7 @@ fn read_value_profile_data(mut input: &[u8]) -> ParseResult<Option<Box<ValueProf
190190
191191impl InstrProfReader for TextInstrProf {
192192 type Header = Header ;
193- fn parse_bytes ( mut input : & [ u8 ] ) -> ParseResult < InstrumentationProfile > {
193+ fn parse_bytes ( mut input : & [ u8 ] ) -> ParseResult < ' _ , InstrumentationProfile > {
194194 let ( bytes, header) = Self :: parse_header ( input) ?;
195195 let ( bytes, _) = skip_to_content ( bytes) ?;
196196 input = bytes;
@@ -252,7 +252,7 @@ impl InstrProfReader for TextInstrProf {
252252 Ok ( ( bytes, result) )
253253 }
254254
255- fn parse_header ( input : & [ u8 ] ) -> ParseResult < Self :: Header > {
255+ fn parse_header ( input : & [ u8 ] ) -> ParseResult < ' _ , Self :: Header > {
256256 let ( input, _) = skip_to_content ( input) ?;
257257 let ( bytes, names) = parse_header_tags ( input) ?;
258258 let mut is_ir_level = false ;
0 commit comments