5
5
use itertools:: Itertools ;
6
6
7
7
use crate :: {
8
- ast:: { self , child_opt , children , support, AstChildren , AstNode , AstToken } ,
8
+ ast:: { self , support, AstChildren , AstNode , AstToken } ,
9
9
syntax_node:: SyntaxElementChildren ,
10
10
} ;
11
11
12
12
pub trait TypeAscriptionOwner : AstNode {
13
13
fn ascribed_type ( & self ) -> Option < ast:: TypeRef > {
14
- child_opt ( self )
14
+ support :: child ( self . syntax ( ) )
15
15
}
16
16
}
17
17
18
18
pub trait NameOwner : AstNode {
19
19
fn name ( & self ) -> Option < ast:: Name > {
20
- child_opt ( self )
20
+ support :: child ( self . syntax ( ) )
21
21
}
22
22
}
23
23
24
24
pub trait VisibilityOwner : AstNode {
25
25
fn visibility ( & self ) -> Option < ast:: Visibility > {
26
- child_opt ( self )
26
+ support :: child ( self . syntax ( ) )
27
27
}
28
28
}
29
29
30
30
pub trait LoopBodyOwner : AstNode {
31
31
fn loop_body ( & self ) -> Option < ast:: BlockExpr > {
32
- child_opt ( self )
32
+ support :: child ( self . syntax ( ) )
33
33
}
34
34
35
35
fn label ( & self ) -> Option < ast:: Label > {
36
- child_opt ( self )
36
+ support :: child ( self . syntax ( ) )
37
37
}
38
38
}
39
39
40
40
pub trait ArgListOwner : AstNode {
41
41
fn arg_list ( & self ) -> Option < ast:: ArgList > {
42
- child_opt ( self )
42
+ support :: child ( self . syntax ( ) )
43
43
}
44
44
}
45
45
46
46
pub trait FnDefOwner : AstNode {
47
47
fn functions ( & self ) -> AstChildren < ast:: FnDef > {
48
- children ( self )
48
+ support :: children ( self . syntax ( ) )
49
49
}
50
50
}
51
51
52
52
pub trait ModuleItemOwner : AstNode {
53
53
fn items ( & self ) -> AstChildren < ast:: ModuleItem > {
54
- children ( self )
54
+ support :: children ( self . syntax ( ) )
55
55
}
56
56
}
57
57
58
58
pub trait TypeParamsOwner : AstNode {
59
59
fn type_param_list ( & self ) -> Option < ast:: TypeParamList > {
60
- child_opt ( self )
60
+ support :: child ( self . syntax ( ) )
61
61
}
62
62
63
63
fn where_clause ( & self ) -> Option < ast:: WhereClause > {
64
- child_opt ( self )
64
+ support :: child ( self . syntax ( ) )
65
65
}
66
66
}
67
67
68
68
pub trait TypeBoundsOwner : AstNode {
69
69
fn type_bound_list ( & self ) -> Option < ast:: TypeBoundList > {
70
- child_opt ( self )
70
+ support :: child ( self . syntax ( ) )
71
71
}
72
72
73
73
fn colon ( & self ) -> Option < ast:: Colon > {
@@ -77,7 +77,7 @@ pub trait TypeBoundsOwner: AstNode {
77
77
78
78
pub trait AttrsOwner : AstNode {
79
79
fn attrs ( & self ) -> AstChildren < ast:: Attr > {
80
- children ( self )
80
+ support :: children ( self . syntax ( ) )
81
81
}
82
82
fn has_atom_attr ( & self , atom : & str ) -> bool {
83
83
self . attrs ( ) . filter_map ( |x| x. as_simple_atom ( ) ) . any ( |x| x == atom)
0 commit comments