Apply manual_is_variant_and to Clippy itself

This commit is contained in:
linshuy2
2026-02-05 23:28:48 +00:00
parent 2753bf0954
commit 8a31b2f698
3 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ pub(super) fn check(cx: &LateContext<'_>, metadata: &Metadata, ignore_publish: b
for package in &metadata.packages {
// only run the lint if publish is `None` (`publish = true` or skipped entirely)
// or if the vector isn't empty (`publish = ["something"]`)
if package.publish.as_ref().filter(|publish| publish.is_empty()).is_none() || ignore_publish {
if package.publish.as_ref().is_none_or(|publish| !publish.is_empty()) || ignore_publish {
if is_empty_str(package.description.as_ref()) {
missing_warning(cx, package, "package.description");
}
@@ -702,8 +702,7 @@ fn check_if_applicable_to_argument<'tcx>(cx: &LateContext<'tcx>, arg: &Expr<'tcx
sym::to_vec => cx
.tcx
.impl_of_assoc(method_def_id)
.filter(|&impl_did| cx.tcx.type_of(impl_did).instantiate_identity().is_slice())
.is_some(),
.is_some_and(|impl_did| cx.tcx.type_of(impl_did).instantiate_identity().is_slice()),
_ => false,
}
&& let original_arg_ty = cx.typeck_results().node_type(caller.hir_id).peel_refs()
+1 -2
View File
@@ -490,8 +490,7 @@ fn check_if_let_some_or_err_and_early_return<'tcx>(cx: &LateContext<'tcx>, expr:
|| is_early_return(sym::Result, cx, &if_block))
&& if_else
.map(|e| eq_expr_value(cx, let_expr, peel_blocks(e)))
.filter(|e| *e)
.is_none()
.is_none_or(|e| !e)
{
if !is_copy(cx, caller_ty)
&& let Some(hir_id) = let_expr.res_local_id()