Skip to content

Commit e812a8a

Browse files
committed
use .all instead of negative use of .any
1 parent e322c77 commit e812a8a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_utils/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1506,13 +1506,13 @@ fn is_normalizable_helper<'tcx>(
15061506
let cause = rustc_middle::traits::ObligationCause::dummy();
15071507
if infcx.at(&cause, param_env).normalize(ty).is_ok() {
15081508
match ty.kind() {
1509-
ty::Adt(def, substs) => !def.variants.iter().any(|variant| {
1509+
ty::Adt(def, substs) => def.variants.iter().all(|variant| {
15101510
variant
15111511
.fields
15121512
.iter()
1513-
.any(|field| !is_normalizable_helper(cx, param_env, field.ty(cx.tcx, substs), cache))
1513+
.all(|field| is_normalizable_helper(cx, param_env, field.ty(cx.tcx, substs), cache))
15141514
}),
1515-
_ => !ty.walk().any(|generic_arg| !match generic_arg.unpack() {
1515+
_ => ty.walk().all(|generic_arg| match generic_arg.unpack() {
15161516
GenericArgKind::Type(inner_ty) if inner_ty != ty => {
15171517
is_normalizable_helper(cx, param_env, inner_ty, cache)
15181518
},

0 commit comments

Comments
 (0)