From cad762b1e24e350af3422b50b81e8b4e3b8393a0 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 8 Jun 2021 16:52:33 -0300 Subject: [PATCH] Use impl FnMut directly as predicate type --- compiler/rustc_data_structures/src/vec_map.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/rustc_data_structures/src/vec_map.rs b/compiler/rustc_data_structures/src/vec_map.rs index 81d7fe3f6bd20..ceafdbbce2658 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

(&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) }