Skip to content

Commit cad762b

Browse files
committed
Use impl FnMut directly as predicate type
1 parent ed94da1 commit cad762b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_data_structures/src/vec_map.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ where
3333
self.0.iter().find(|(key, _)| k == key.borrow()).map(|elem| &elem.1)
3434
}
3535

36-
pub fn get_by<P>(&self, mut predicate: P) -> Option<&V>
37-
where
38-
for<'b> P: FnMut(&'b &(K, V)) -> bool,
39-
{
36+
pub fn get_by(&self, mut predicate: impl FnMut(&(K, V)) -> bool) -> Option<&V> {
4037
self.0.iter().find(|kv| predicate(kv)).map(|elem| &elem.1)
4138
}
4239

0 commit comments

Comments
 (0)