@@ -51,7 +51,7 @@ pub enum RawStrError {
51
51
TooManyDelimiters { found : usize } ,
52
52
}
53
53
54
- pub ( crate ) fn number ( cursor : & mut Cursor , first_digit : char ) -> LiteralKind {
54
+ pub ( crate ) fn number ( cursor : & mut Cursor < ' _ > , first_digit : char ) -> LiteralKind {
55
55
debug_assert ! ( '0' <= cursor. prev( ) && cursor. prev( ) <= '9' ) ;
56
56
let mut base = Base :: Decimal ;
57
57
if first_digit == '0' {
@@ -120,7 +120,7 @@ pub(crate) fn number(cursor: &mut Cursor, first_digit: char) -> LiteralKind {
120
120
}
121
121
}
122
122
123
- pub ( crate ) fn eat_decimal_digits ( cursor : & mut Cursor ) -> bool {
123
+ pub ( crate ) fn eat_decimal_digits ( cursor : & mut Cursor < ' _ > ) -> bool {
124
124
let mut has_digits = false ;
125
125
loop {
126
126
match cursor. peek ( ) {
@@ -137,7 +137,7 @@ pub(crate) fn eat_decimal_digits(cursor: &mut Cursor) -> bool {
137
137
has_digits
138
138
}
139
139
140
- pub ( crate ) fn eat_hexadecimal_digits ( cursor : & mut Cursor ) -> bool {
140
+ pub ( crate ) fn eat_hexadecimal_digits ( cursor : & mut Cursor < ' _ > ) -> bool {
141
141
let mut has_digits = false ;
142
142
loop {
143
143
match cursor. peek ( ) {
@@ -156,15 +156,15 @@ pub(crate) fn eat_hexadecimal_digits(cursor: &mut Cursor) -> bool {
156
156
157
157
/// Eats the float exponent. Returns true if at least one digit was met,
158
158
/// and returns false otherwise.
159
- fn eat_float_exponent ( cursor : & mut Cursor ) -> bool {
159
+ fn eat_float_exponent ( cursor : & mut Cursor < ' _ > ) -> bool {
160
160
debug_assert ! ( cursor. prev( ) == 'e' || cursor. prev( ) == 'E' ) ;
161
161
if cursor. peek ( ) == '-' || cursor. peek ( ) == '+' {
162
162
cursor. bump ( ) ;
163
163
}
164
164
eat_decimal_digits ( cursor)
165
165
}
166
166
167
- pub ( crate ) fn lifetime_or_char ( cursor : & mut Cursor ) -> TokenKind {
167
+ pub ( crate ) fn lifetime_or_char ( cursor : & mut Cursor < ' _ > ) -> TokenKind {
168
168
debug_assert ! ( cursor. prev( ) == '\'' ) ;
169
169
170
170
let can_be_a_lifetime = if cursor. peek_second ( ) == '\'' {
@@ -210,7 +210,7 @@ pub(crate) fn lifetime_or_char(cursor: &mut Cursor) -> TokenKind {
210
210
}
211
211
}
212
212
213
- pub ( crate ) fn single_quoted_string ( cursor : & mut Cursor ) -> bool {
213
+ pub ( crate ) fn single_quoted_string ( cursor : & mut Cursor < ' _ > ) -> bool {
214
214
debug_assert ! ( cursor. prev( ) == '\'' ) ;
215
215
// Check if it's a one-symbol literal.
216
216
if cursor. peek_second ( ) == '\'' && cursor. peek ( ) != '\\' {
@@ -253,7 +253,7 @@ pub(crate) fn single_quoted_string(cursor: &mut Cursor) -> bool {
253
253
254
254
/// Eats double-quoted string and returns true
255
255
/// if string is terminated.
256
- pub ( crate ) fn double_quoted_string ( cursor : & mut Cursor ) -> bool {
256
+ pub ( crate ) fn double_quoted_string ( cursor : & mut Cursor < ' _ > ) -> bool {
257
257
debug_assert ! ( cursor. prev( ) == '"' ) ;
258
258
while let Some ( c) = cursor. bump ( ) {
259
259
match c {
@@ -273,7 +273,7 @@ pub(crate) fn double_quoted_string(cursor: &mut Cursor) -> bool {
273
273
274
274
/// Eats the double-quoted string and returns `n_hashes` and an error if encountered.
275
275
pub ( crate ) fn raw_double_quoted_string (
276
- cursor : & mut Cursor ,
276
+ cursor : & mut Cursor < ' _ > ,
277
277
prefix_len : usize ,
278
278
) -> ( u16 , Option < RawStrError > ) {
279
279
// Wrap the actual function to handle the error with too many hashes.
@@ -288,7 +288,10 @@ pub(crate) fn raw_double_quoted_string(
288
288
}
289
289
}
290
290
291
- fn raw_string_unvalidated ( cursor : & mut Cursor , prefix_len : usize ) -> ( usize , Option < RawStrError > ) {
291
+ fn raw_string_unvalidated (
292
+ cursor : & mut Cursor < ' _ > ,
293
+ prefix_len : usize ,
294
+ ) -> ( usize , Option < RawStrError > ) {
292
295
debug_assert ! ( cursor. prev( ) == 'r' ) ;
293
296
let start_pos = cursor. len_consumed ( ) ;
294
297
let mut possible_terminator_offset = None ;
@@ -354,7 +357,7 @@ fn raw_string_unvalidated(cursor: &mut Cursor, prefix_len: usize) -> (usize, Opt
354
357
}
355
358
356
359
/// Eats the suffix of a literal, e.g. "_u8".
357
- pub ( crate ) fn eat_literal_suffix ( cursor : & mut Cursor ) {
360
+ pub ( crate ) fn eat_literal_suffix ( cursor : & mut Cursor < ' _ > ) {
358
361
// Eats one identifier.
359
362
if is_id_start ( cursor. peek ( ) ) {
360
363
cursor. bump ( ) ;
0 commit comments