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.
1 parent c80d062 commit dd56ec6Copy full SHA for dd56ec6
compiler/rustc_data_structures/src/vec_map.rs
@@ -33,6 +33,13 @@ 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>
37
+ where
38
+ for<'b> P: FnMut(&'b &(K, V)) -> bool,
39
+ {
40
+ self.0.iter().find(predicate).map(|elem| &elem.1)
41
+ }
42
+
43
pub fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool
44
where
45
K: Borrow<Q>,
0 commit comments