Skip to content

Commit 1c0e120

Browse files
committed
apply manual_contains to Clippy sources
1 parent fd17bfe commit 1c0e120

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

clippy_lints/src/booleans.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ impl<'tcx> NonminimalBoolVisitor<'_, 'tcx> {
555555
_ => simplified.push(Bool::Not(Box::new(simple.clone()))),
556556
}
557557
let simple_negated = simple_negate(simple);
558-
if simplified.iter().any(|s| *s == simple_negated) {
558+
if simplified.contains(&simple_negated) {
559559
continue;
560560
}
561561
simplified.push(simple_negated);

clippy_lints/src/casts/cast_sign_loss.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ fn expr_sign<'cx, 'tcx>(cx: &LateContext<'cx>, mut expr: &'tcx Expr<'tcx>, ty: i
142142
expr = recv;
143143
}
144144

145-
if METHODS_POW.iter().any(|&name| method_name == name)
145+
if METHODS_POW.contains(&method_name)
146146
&& let [arg] = args
147147
{
148148
return pow_call_result_sign(cx, caller, arg);
149-
} else if METHODS_RET_POSITIVE.iter().any(|&name| method_name == name) {
149+
} else if METHODS_RET_POSITIVE.contains(&method_name) {
150150
return Sign::ZeroOrPositive;
151151
}
152152
}

clippy_lints/src/size_of_in_element_count.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn get_pointee_ty_and_count_expr<'tcx>(
9999
if let ExprKind::MethodCall(method_path, ptr_self, [.., count], _) = expr.kind
100100
// Find calls to copy_{from,to}{,_nonoverlapping}
101101
&& let method_ident = method_path.ident.as_str()
102-
&& METHODS.iter().any(|m| *m == method_ident)
102+
&& METHODS.contains(&method_ident)
103103

104104
// Get the pointee type
105105
&& let ty::RawPtr(pointee_ty, _) =

0 commit comments

Comments
 (0)