From: Matthias Krüger Date: Wed, 21 Jul 2021 19:46:02 +0000 (+0200) Subject: clippy::filter_next X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=066eb6ab5d516259a330eaab3a2254990ad33593;p=rust.git clippy::filter_next --- 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 9a33875d6e4..9c4db5b70ae 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(