diff options
Diffstat (limited to 'crates/ra_syntax/src/ast/node_ext.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/node_ext.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/ast/node_ext.rs b/crates/ra_syntax/src/ast/node_ext.rs index bba7310ad..30c2db56b 100644 --- a/crates/ra_syntax/src/ast/node_ext.rs +++ b/crates/ra_syntax/src/ast/node_ext.rs | |||
@@ -82,7 +82,7 @@ impl ast::Attr { | |||
82 | #[derive(Debug, Clone, PartialEq, Eq)] | 82 | #[derive(Debug, Clone, PartialEq, Eq)] |
83 | pub enum PathSegmentKind { | 83 | pub enum PathSegmentKind { |
84 | Name(ast::NameRef), | 84 | Name(ast::NameRef), |
85 | Type { type_ref: Option<ast::TypeRef>, trait_ref: Option<ast::PathType> }, | 85 | Type { type_ref: Option<ast::Type>, trait_ref: Option<ast::PathType> }, |
86 | SelfKw, | 86 | SelfKw, |
87 | SuperKw, | 87 | SuperKw, |
88 | CrateKw, | 88 | CrateKw, |
@@ -108,8 +108,8 @@ impl ast::PathSegment { | |||
108 | // <T> or <T as Trait> | 108 | // <T> or <T as Trait> |
109 | // T is any TypeRef, Trait has to be a PathType | 109 | // T is any TypeRef, Trait has to be a PathType |
110 | let mut type_refs = | 110 | let mut type_refs = |
111 | self.syntax().children().filter(|node| ast::TypeRef::can_cast(node.kind())); | 111 | self.syntax().children().filter(|node| ast::Type::can_cast(node.kind())); |
112 | let type_ref = type_refs.next().and_then(ast::TypeRef::cast); | 112 | let type_ref = type_refs.next().and_then(ast::Type::cast); |
113 | let trait_ref = type_refs.next().and_then(ast::PathType::cast); | 113 | let trait_ref = type_refs.next().and_then(ast::PathType::cast); |
114 | PathSegmentKind::Type { type_ref, trait_ref } | 114 | PathSegmentKind::Type { type_ref, trait_ref } |
115 | } | 115 | } |
@@ -136,21 +136,21 @@ impl ast::UseTreeList { | |||
136 | } | 136 | } |
137 | 137 | ||
138 | impl ast::Impl { | 138 | impl ast::Impl { |
139 | pub fn target_type(&self) -> Option<ast::TypeRef> { | 139 | pub fn target_type(&self) -> Option<ast::Type> { |
140 | match self.target() { | 140 | match self.target() { |
141 | (Some(t), None) | (_, Some(t)) => Some(t), | 141 | (Some(t), None) | (_, Some(t)) => Some(t), |
142 | _ => None, | 142 | _ => None, |
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | pub fn target_trait(&self) -> Option<ast::TypeRef> { | 146 | pub fn target_trait(&self) -> Option<ast::Type> { |
147 | match self.target() { | 147 | match self.target() { |
148 | (Some(t), Some(_)) => Some(t), | 148 | (Some(t), Some(_)) => Some(t), |
149 | _ => None, | 149 | _ => None, |
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | fn target(&self) -> (Option<ast::TypeRef>, Option<ast::TypeRef>) { | 153 | fn target(&self) -> (Option<ast::Type>, Option<ast::Type>) { |
154 | let mut types = support::children(self.syntax()); | 154 | let mut types = support::children(self.syntax()); |
155 | let first = types.next(); | 155 | let first = types.next(); |
156 | let second = types.next(); | 156 | let second = types.next(); |