Skip to content

Commit 066eb6a

Browse files
committed
clippy::filter_next
1 parent aa74c75 commit 066eb6a

File tree

1 file changed

+3
-7
lines changed
  • compiler/rustc_trait_selection/src/traits/error_reporting

1 file changed

+3
-7
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,9 @@ fn suggest_restriction(
290290
} else {
291291
// Trivial case: `T` needs an extra bound: `T: Bound`.
292292
let (sp, suggestion) = match (
293-
generics
294-
.params
295-
.iter()
296-
.filter(|p| {
297-
!matches!(p.kind, hir::GenericParamKind::Type { synthetic: Some(_), .. })
298-
})
299-
.next(),
293+
generics.params.iter().find(|p| {
294+
!matches!(p.kind, hir::GenericParamKind::Type { synthetic: Some(_), .. })
295+
}),
300296
super_traits,
301297
) {
302298
(_, None) => predicate_constraint(

0 commit comments

Comments
 (0)