Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions compiler/rustc_data_structures/src/vec_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ where
self.0.iter().find(|(key, _)| k == key.borrow()).map(|elem| &elem.1)
}

pub fn get_by<P>(&self, predicate: P) -> Option<&V>
where
for<'b> P: FnMut(&'b &(K, V)) -> bool,
{
self.0.iter().find(predicate).map(|elem| &elem.1)
}

pub fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool
where
K: Borrow<Q>,
Expand Down