diff options
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 81c709bfb..d8c2cb063 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -114,6 +114,9 @@ pub trait AttrsOwner: AstNode { | |||
114 | fn attrs(&self) -> AstChildren<Attr> { | 114 | fn attrs(&self) -> AstChildren<Attr> { |
115 | children(self) | 115 | children(self) |
116 | } | 116 | } |
117 | fn has_atom_attr(&self, atom: &str) -> bool { | ||
118 | self.attrs().filter_map(|x| x.as_atom()).any(|x| x == atom) | ||
119 | } | ||
117 | } | 120 | } |
118 | 121 | ||
119 | pub trait DocCommentsOwner: AstNode { | 122 | pub trait DocCommentsOwner: AstNode { |
@@ -153,12 +156,6 @@ pub trait DocCommentsOwner: AstNode { | |||
153 | } | 156 | } |
154 | } | 157 | } |
155 | 158 | ||
156 | impl FnDef { | ||
157 | pub fn has_atom_attr(&self, atom: &str) -> bool { | ||
158 | self.attrs().filter_map(|x| x.as_atom()).any(|x| x == atom) | ||
159 | } | ||
160 | } | ||
161 | |||
162 | impl Attr { | 159 | impl Attr { |
163 | pub fn is_inner(&self) -> bool { | 160 | pub fn is_inner(&self) -> bool { |
164 | let tt = match self.value() { | 161 | let tt = match self.value() { |