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:50:33 -0300
committerSantiago Pastorino <spastorino@gmail.com>2021-06-08 17:17:47 -0300
commited94da14ed19c20baf8912c69b427fe910bf5d5f (patch)
tree50ad8ac7429b5297021c1d97272525a9c0b8d090 /compiler/rustc_data_structures/src/vec_map.rs
parent0ad09f938606b1a603300a93570da4a16cb7b5f2 (diff)
downloadrust-ed94da14ed19c20baf8912c69b427fe910bf5d5f.tar.gz
rust-ed94da14ed19c20baf8912c69b427fe910bf5d5f.zip
Explicitly pass find arguments down the predicate so coercions can apply
Diffstat (limited to 'compiler/rustc_data_structures/src/vec_map.rs')
-rw-r--r--compiler/rustc_data_structures/src/vec_map.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_data_structures/src/vec_map.rs b/compiler/rustc_data_structures/src/vec_map.rs
index fef570c786b..81d7fe3f6bd 100644
--- a/compiler/rustc_data_structures/src/vec_map.rs
+++ b/compiler/rustc_data_structures/src/vec_map.rs
@@ -33,11 +33,11 @@ where
         self.0.iter().find(|(key, _)| k == key.borrow()).map(|elem| &elem.1)
     }
 
-    pub fn get_by<P>(&self, predicate: P) -> Option<&V>
+    pub fn get_by<P>(&self, mut predicate: P) -> Option<&V>
     where
         for<'b> P: FnMut(&'b &(K, V)) -> bool,
     {
-        self.0.iter().find(predicate).map(|elem| &elem.1)
+        self.0.iter().find(|kv| predicate(kv)).map(|elem| &elem.1)
     }
 
     pub fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool