We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ad09f9 commit ed94da1Copy full SHA for ed94da1
compiler/rustc_data_structures/src/vec_map.rs
@@ -33,11 +33,11 @@ where
33
self.0.iter().find(|(key, _)| k == key.borrow()).map(|elem| &elem.1)
34
}
35
36
- pub fn get_by<P>(&self, predicate: P) -> Option<&V>
+ pub fn get_by<P>(&self, mut predicate: P) -> Option<&V>
37
where
38
for<'b> P: FnMut(&'b &(K, V)) -> bool,
39
{
40
- self.0.iter().find(predicate).map(|elem| &elem.1)
+ self.0.iter().find(|kv| predicate(kv)).map(|elem| &elem.1)
41
42
43
pub fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool
0 commit comments