We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents db43080 + 6052477 commit 3714800Copy full SHA for 3714800
crates/ra_hir/src/ty/method_resolution.rs
@@ -136,8 +136,8 @@ impl Ty {
136
})
137
}
138
139
- // This would be nicer if it just returned an iterator, but that's really
140
- // 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`.
141
pub fn iterate_methods<T>(
142
self,
143
db: &impl HirDatabase,
@@ -163,7 +163,7 @@ impl Ty {
163
for item in impl_block.items() {
164
match item {
165
ImplItem::Method(f) => {
166
- if let Some(result) = callback(f.clone()) {
+ if let Some(result) = callback(*f) {
167
return Some(result);
168
169
0 commit comments