@@ -322,9 +322,9 @@ pub struct ParamList {
322
322
}
323
323
impl ParamList {
324
324
pub fn l_paren_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ '(' ] ) }
325
- pub fn params ( & self ) -> AstChildren < Param > { support:: children ( & self . syntax ) }
326
325
pub fn self_param ( & self ) -> Option < SelfParam > { support:: child ( & self . syntax ) }
327
326
pub fn comma_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ , ] ) }
327
+ pub fn params ( & self ) -> AstChildren < Param > { support:: children ( & self . syntax ) }
328
328
pub fn r_paren_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ ')' ] ) }
329
329
}
330
330
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
@@ -357,17 +357,6 @@ impl BlockExpr {
357
357
pub fn r_curly_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ '}' ] ) }
358
358
}
359
359
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
360
- pub struct Param {
361
- pub ( crate ) syntax : SyntaxNode ,
362
- }
363
- impl ast:: AttrsOwner for Param { }
364
- impl ast:: TypeAscriptionOwner for Param { }
365
- impl Param {
366
- pub fn pat ( & self ) -> Option < Pat > { support:: child ( & self . syntax ) }
367
- pub fn colon_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ : ] ) }
368
- pub fn dotdotdot_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ ...] ) }
369
- }
370
- #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
371
360
pub struct SelfParam {
372
361
pub ( crate ) syntax : SyntaxNode ,
373
362
}
@@ -383,6 +372,17 @@ impl SelfParam {
383
372
pub fn colon_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ : ] ) }
384
373
}
385
374
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
375
+ pub struct Param {
376
+ pub ( crate ) syntax : SyntaxNode ,
377
+ }
378
+ impl ast:: AttrsOwner for Param { }
379
+ impl ast:: TypeAscriptionOwner for Param { }
380
+ impl Param {
381
+ pub fn pat ( & self ) -> Option < Pat > { support:: child ( & self . syntax ) }
382
+ pub fn colon_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ : ] ) }
383
+ pub fn dotdotdot_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ ...] ) }
384
+ }
385
+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
386
386
pub struct TypeBoundList {
387
387
pub ( crate ) syntax : SyntaxNode ,
388
388
}
@@ -1724,8 +1724,8 @@ impl AstNode for BlockExpr {
1724
1724
}
1725
1725
fn syntax ( & self ) -> & SyntaxNode { & self . syntax }
1726
1726
}
1727
- impl AstNode for Param {
1728
- fn can_cast ( kind : SyntaxKind ) -> bool { kind == PARAM }
1727
+ impl AstNode for SelfParam {
1728
+ fn can_cast ( kind : SyntaxKind ) -> bool { kind == SELF_PARAM }
1729
1729
fn cast ( syntax : SyntaxNode ) -> Option < Self > {
1730
1730
if Self :: can_cast ( syntax. kind ( ) ) {
1731
1731
Some ( Self { syntax } )
@@ -1735,8 +1735,8 @@ impl AstNode for Param {
1735
1735
}
1736
1736
fn syntax ( & self ) -> & SyntaxNode { & self . syntax }
1737
1737
}
1738
- impl AstNode for SelfParam {
1739
- fn can_cast ( kind : SyntaxKind ) -> bool { kind == SELF_PARAM }
1738
+ impl AstNode for Param {
1739
+ fn can_cast ( kind : SyntaxKind ) -> bool { kind == PARAM }
1740
1740
fn cast ( syntax : SyntaxNode ) -> Option < Self > {
1741
1741
if Self :: can_cast ( syntax. kind ( ) ) {
1742
1742
Some ( Self { syntax } )
@@ -3599,12 +3599,12 @@ impl std::fmt::Display for BlockExpr {
3599
3599
std:: fmt:: Display :: fmt ( self . syntax ( ) , f)
3600
3600
}
3601
3601
}
3602
- impl std:: fmt:: Display for Param {
3602
+ impl std:: fmt:: Display for SelfParam {
3603
3603
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
3604
3604
std:: fmt:: Display :: fmt ( self . syntax ( ) , f)
3605
3605
}
3606
3606
}
3607
- impl std:: fmt:: Display for SelfParam {
3607
+ impl std:: fmt:: Display for Param {
3608
3608
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
3609
3609
std:: fmt:: Display :: fmt ( self . syntax ( ) , f)
3610
3610
}
0 commit comments