diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index da7587f015ae..b8e911b88b05 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs @@ -136,8 +136,8 @@ impl Ty { }) } - // This would be nicer if it just returned an iterator, but that's really - // complicated with all the cancelable operations + // This would be nicer if it just returned an iterator, but that runs into + // lifetime problems, because we need to borrow temp `CrateImplBlocks`. pub fn iterate_methods( self, db: &impl HirDatabase, @@ -163,7 +163,7 @@ impl Ty { for item in impl_block.items() { match item { ImplItem::Method(f) => { - if let Some(result) = callback(f.clone()) { + if let Some(result) = callback(*f) { return Some(result); } }