about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-07-21 21:46:02 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2021-07-25 12:26:02 +0200
commit066eb6ab5d516259a330eaab3a2254990ad33593 (patch)
tree0a222f10b13dee03972b72878dfd5ac7170e07d0
parentaa74c75d849b63135c922c9c74324944af5bc487 (diff)
downloadrust-066eb6ab5d516259a330eaab3a2254990ad33593.tar.gz
rust-066eb6ab5d516259a330eaab3a2254990ad33593.zip
clippy::filter_next
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs10
1 files 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 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(