@@ -24,7 +24,8 @@ impl Attr {
2424 pub fn l_brack_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ '[' ] ) }
2525 pub fn path ( & self ) -> Option < Path > { support:: child ( & self . syntax ) }
2626 pub fn eq_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ =] ) }
27- pub fn input ( & self ) -> Option < AttrInput > { support:: child ( & self . syntax ) }
27+ pub fn literal ( & self ) -> Option < Literal > { support:: child ( & self . syntax ) }
28+ pub fn token_tree ( & self ) -> Option < TokenTree > { support:: child ( & self . syntax ) }
2829 pub fn r_brack_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ ']' ] ) }
2930}
3031#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
@@ -1378,11 +1379,6 @@ pub enum GenericParam {
13781379}
13791380impl ast:: AttrsOwner for GenericParam { }
13801381#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
1381- pub enum AttrInput {
1382- Literal ( Literal ) ,
1383- TokenTree ( TokenTree ) ,
1384- }
1385- #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
13861382pub enum Stmt {
13871383 LetStmt ( LetStmt ) ,
13881384 ExprStmt ( ExprStmt ) ,
@@ -3342,34 +3338,6 @@ impl AstNode for GenericParam {
33423338 }
33433339 }
33443340}
3345- impl From < Literal > for AttrInput {
3346- fn from ( node : Literal ) -> AttrInput { AttrInput :: Literal ( node) }
3347- }
3348- impl From < TokenTree > for AttrInput {
3349- fn from ( node : TokenTree ) -> AttrInput { AttrInput :: TokenTree ( node) }
3350- }
3351- impl AstNode for AttrInput {
3352- fn can_cast ( kind : SyntaxKind ) -> bool {
3353- match kind {
3354- LITERAL | TOKEN_TREE => true ,
3355- _ => false ,
3356- }
3357- }
3358- fn cast ( syntax : SyntaxNode ) -> Option < Self > {
3359- let res = match syntax. kind ( ) {
3360- LITERAL => AttrInput :: Literal ( Literal { syntax } ) ,
3361- TOKEN_TREE => AttrInput :: TokenTree ( TokenTree { syntax } ) ,
3362- _ => return None ,
3363- } ;
3364- Some ( res)
3365- }
3366- fn syntax ( & self ) -> & SyntaxNode {
3367- match self {
3368- AttrInput :: Literal ( it) => & it. syntax ,
3369- AttrInput :: TokenTree ( it) => & it. syntax ,
3370- }
3371- }
3372- }
33733341impl From < LetStmt > for Stmt {
33743342 fn from ( node : LetStmt ) -> Stmt { Stmt :: LetStmt ( node) }
33753343}
@@ -3471,11 +3439,6 @@ impl std::fmt::Display for GenericParam {
34713439 std:: fmt:: Display :: fmt ( self . syntax ( ) , f)
34723440 }
34733441}
3474- impl std:: fmt:: Display for AttrInput {
3475- fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
3476- std:: fmt:: Display :: fmt ( self . syntax ( ) , f)
3477- }
3478- }
34793442impl std:: fmt:: Display for Stmt {
34803443 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
34813444 std:: fmt:: Display :: fmt ( self . syntax ( ) , f)
0 commit comments