@@ -74,7 +74,7 @@ impl MetaVarExpr {
74
74
}
75
75
} ;
76
76
result. push ( element) ;
77
- if iter. look_ahead ( 0 ) . is_none ( ) {
77
+ if iter. peek ( ) . is_none ( ) {
78
78
break ;
79
79
}
80
80
if !try_eat_comma ( & mut iter) {
@@ -166,7 +166,7 @@ fn parse_count<'psess>(
166
166
eat_dollar ( iter, psess, span) ?;
167
167
let ident = parse_ident ( iter, psess, span) ?;
168
168
let depth = if try_eat_comma ( iter) {
169
- if iter. look_ahead ( 0 ) . is_none ( ) {
169
+ if iter. peek ( ) . is_none ( ) {
170
170
return Err ( psess. dcx ( ) . struct_span_err (
171
171
span,
172
172
"`count` followed by a comma must have an associated index indicating its depth" ,
@@ -252,7 +252,7 @@ fn parse_token<'psess, 't>(
252
252
/// Tries to move the iterator forward returning `true` if there is a comma. If not, then the
253
253
/// iterator is not modified and the result is `false`.
254
254
fn try_eat_comma ( iter : & mut RefTokenTreeCursor < ' _ > ) -> bool {
255
- if let Some ( TokenTree :: Token ( Token { kind : token:: Comma , .. } , _) ) = iter. look_ahead ( 0 ) {
255
+ if let Some ( TokenTree :: Token ( Token { kind : token:: Comma , .. } , _) ) = iter. peek ( ) {
256
256
let _ = iter. next ( ) ;
257
257
return true ;
258
258
}
@@ -262,7 +262,7 @@ fn try_eat_comma(iter: &mut RefTokenTreeCursor<'_>) -> bool {
262
262
/// Tries to move the iterator forward returning `true` if there is a dollar sign. If not, then the
263
263
/// iterator is not modified and the result is `false`.
264
264
fn try_eat_dollar ( iter : & mut RefTokenTreeCursor < ' _ > ) -> bool {
265
- if let Some ( TokenTree :: Token ( Token { kind : token:: Dollar , .. } , _) ) = iter. look_ahead ( 0 ) {
265
+ if let Some ( TokenTree :: Token ( Token { kind : token:: Dollar , .. } , _) ) = iter. peek ( ) {
266
266
let _ = iter. next ( ) ;
267
267
return true ;
268
268
}
@@ -275,7 +275,7 @@ fn eat_dollar<'psess>(
275
275
psess : & ' psess ParseSess ,
276
276
span : Span ,
277
277
) -> PResult < ' psess , ( ) > {
278
- if let Some ( TokenTree :: Token ( Token { kind : token:: Dollar , .. } , _) ) = iter. look_ahead ( 0 ) {
278
+ if let Some ( TokenTree :: Token ( Token { kind : token:: Dollar , .. } , _) ) = iter. peek ( ) {
279
279
let _ = iter. next ( ) ;
280
280
return Ok ( ( ) ) ;
281
281
}
0 commit comments