@@ -279,7 +279,7 @@ pub enum SelfParamKind {
279
279
impl ast:: SelfParam {
280
280
pub fn kind ( & self ) -> SelfParamKind {
281
281
if self . amp_token ( ) . is_some ( ) {
282
- if self . amp_mut_kw_token ( ) . is_some ( ) {
282
+ if self . amp_mut_token ( ) . is_some ( ) {
283
283
SelfParamKind :: MutRef
284
284
} else {
285
285
SelfParamKind :: Ref
@@ -290,21 +290,21 @@ impl ast::SelfParam {
290
290
}
291
291
292
292
/// the "mut" in "mut self", not the one in "&mut self"
293
- pub fn mut_kw_token ( & self ) -> Option < ast :: MutKw > {
293
+ pub fn mut_token ( & self ) -> Option < SyntaxToken > {
294
294
self . syntax ( )
295
295
. children_with_tokens ( )
296
296
. filter_map ( |it| it. into_token ( ) )
297
297
. take_while ( |it| it. kind ( ) != T ! [ & ] )
298
- . find_map ( ast :: MutKw :: cast )
298
+ . find ( |it| it . kind ( ) == T ! [ mut ] )
299
299
}
300
300
301
301
/// the "mut" in "&mut self", not the one in "mut self"
302
- pub fn amp_mut_kw_token ( & self ) -> Option < ast :: MutKw > {
302
+ pub fn amp_mut_token ( & self ) -> Option < SyntaxToken > {
303
303
self . syntax ( )
304
304
. children_with_tokens ( )
305
305
. filter_map ( |it| it. into_token ( ) )
306
306
. skip_while ( |it| it. kind ( ) != T ! [ & ] )
307
- . find_map ( ast :: MutKw :: cast )
307
+ . find ( |it| it . kind ( ) == T ! [ mut ] )
308
308
}
309
309
}
310
310
@@ -340,7 +340,7 @@ impl ast::TypeBound {
340
340
}
341
341
342
342
pub fn question_token ( & self ) -> Option < ast:: Question > {
343
- if self . const_kw_token ( ) . is_some ( ) {
343
+ if self . const_token ( ) . is_some ( ) {
344
344
self . syntax ( )
345
345
. children_with_tokens ( )
346
346
. filter_map ( |it| it. into_token ( ) )
@@ -364,11 +364,11 @@ impl ast::Visibility {
364
364
pub fn kind ( & self ) -> VisibilityKind {
365
365
if let Some ( path) = support:: children ( self . syntax ( ) ) . next ( ) {
366
366
VisibilityKind :: In ( path)
367
- } else if self . crate_kw_token ( ) . is_some ( ) {
367
+ } else if self . crate_token ( ) . is_some ( ) {
368
368
VisibilityKind :: PubCrate
369
- } else if self . super_kw_token ( ) . is_some ( ) {
369
+ } else if self . super_token ( ) . is_some ( ) {
370
370
VisibilityKind :: PubSuper
371
- } else if self . self_kw_token ( ) . is_some ( ) {
371
+ } else if self . self_token ( ) . is_some ( ) {
372
372
VisibilityKind :: PubSuper
373
373
} else {
374
374
VisibilityKind :: Pub
0 commit comments