diff options
Diffstat (limited to 'crates/ra_hir/src/ty/method_resolution.rs')
-rw-r--r-- | crates/ra_hir/src/ty/method_resolution.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index 8d682bb18..8c3d32d09 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs | |||
@@ -166,12 +166,10 @@ pub(crate) fn lookup_method( | |||
166 | name: &Name, | 166 | name: &Name, |
167 | resolver: &Resolver, | 167 | resolver: &Resolver, |
168 | ) -> Option<(Ty, Function)> { | 168 | ) -> Option<(Ty, Function)> { |
169 | iterate_method_candidates(ty, db, resolver, Some(name), LookupMode::MethodCall, |ty, f| { | 169 | iterate_method_candidates(ty, db, resolver, Some(name), LookupMode::MethodCall, |ty, f| match f |
170 | if let AssocItem::Function(f) = f { | 170 | { |
171 | Some((ty.clone(), f)) | 171 | AssocItem::Function(f) => Some((ty.clone(), f)), |
172 | } else { | 172 | _ => None, |
173 | None | ||
174 | } | ||
175 | }) | 173 | }) |
176 | } | 174 | } |
177 | 175 | ||
@@ -189,6 +187,7 @@ pub enum LookupMode { | |||
189 | 187 | ||
190 | // This would be nicer if it just returned an iterator, but that runs into | 188 | // This would be nicer if it just returned an iterator, but that runs into |
191 | // lifetime problems, because we need to borrow temp `CrateImplBlocks`. | 189 | // lifetime problems, because we need to borrow temp `CrateImplBlocks`. |
190 | // FIXME add a context type here? | ||
192 | pub(crate) fn iterate_method_candidates<T>( | 191 | pub(crate) fn iterate_method_candidates<T>( |
193 | ty: &Canonical<Ty>, | 192 | ty: &Canonical<Ty>, |
194 | db: &impl HirDatabase, | 193 | db: &impl HirDatabase, |