From 066eb6ab5d516259a330eaab3a2254990ad33593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 21 Jul 2021 21:46:02 +0200 Subject: [PATCH] clippy::filter_next --- .../src/traits/error_reporting/suggestions.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index 9a33875d6e49..9c4db5b70ae8 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -290,13 +290,9 @@ fn suggest_restriction( } else { // Trivial case: `T` needs an extra bound: `T: Bound`. let (sp, suggestion) = match ( - generics - .params - .iter() - .filter(|p| { - !matches!(p.kind, hir::GenericParamKind::Type { synthetic: Some(_), .. }) - }) - .next(), + generics.params.iter().find(|p| { + !matches!(p.kind, hir::GenericParamKind::Type { synthetic: Some(_), .. }) + }), super_traits, ) { (_, None) => predicate_constraint(