]> git.lizzy.rs Git - rust.git/commitdiff
clippy::filter_next
authorMatthias Krüger <matthias.krueger@famsik.de>
Wed, 21 Jul 2021 19:46:02 +0000 (21:46 +0200)
committerMatthias Krüger <matthias.krueger@famsik.de>
Sun, 25 Jul 2021 10:26:02 +0000 (12:26 +0200)
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

index 9a33875d6e493f293d9e1efb9c24004b2821681e..9c4db5b70ae876e036be975129cda15db50a1683 100644 (file)
@@ -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(