about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/vec_map.rs
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2021-06-08 16:52:33 -0300
committerSantiago Pastorino <spastorino@gmail.com>2021-06-08 17:17:48 -0300
commitcad762b1e24e350af3422b50b81e8b4e3b8393a0 (patch)
tree3118b7f0981ffa1ed37cc49e3ee2b21c410320ee /compiler/rustc_data_structures/src/vec_map.rs
parented94da14ed19c20baf8912c69b427fe910bf5d5f (diff)
downloadrust-cad762b1e24e350af3422b50b81e8b4e3b8393a0.tar.gz
rust-cad762b1e24e350af3422b50b81e8b4e3b8393a0.zip
Use impl FnMut directly as predicate type
Diffstat (limited to 'compiler/rustc_data_structures/src/vec_map.rs')
-rw-r--r--compiler/rustc_data_structures/src/vec_map.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_data_structures/src/vec_map.rs b/compiler/rustc_data_structures/src/vec_map.rs
index 81d7fe3f6bd..ceafdbbce26 100644
--- a/compiler/rustc_data_structures/src/vec_map.rs
+++ b/compiler/rustc_data_structures/src/vec_map.rs
@@ -33,10 +33,7 @@ where
         self.0.iter().find(|(key, _)| k == key.borrow()).map(|elem| &elem.1)
     }
 
-    pub fn get_by<P>(&self, mut predicate: P) -> Option<&V>
-    where
-        for<'b> P: FnMut(&'b &(K, V)) -> bool,
-    {
+    pub fn get_by(&self, mut predicate: impl FnMut(&(K, V)) -> bool) -> Option<&V> {
         self.0.iter().find(|kv| predicate(kv)).map(|elem| &elem.1)
     }