Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ab155b1

Browse files
committed
Negate results of matches!
1 parent 2af642d commit ab155b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/write.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ impl Write {
443443
return (Some(fmtstr), None);
444444
};
445445
match &token_expr.kind {
446-
ExprKind::Lit(lit) if matches!(lit.kind, LitKind::Int(..) | LitKind::Float(..)) => {
446+
ExprKind::Lit(lit) if !matches!(lit.kind, LitKind::Int(..) | LitKind::Float(..)) => {
447447
let mut all_simple = true;
448448
let mut seen = false;
449449
for arg in &args {
@@ -465,7 +465,7 @@ impl Write {
465465
ExprKind::Assign(lhs, rhs, _) => {
466466
if_chain! {
467467
if let ExprKind::Lit(ref lit) = rhs.kind;
468-
if matches!(lit.kind, LitKind::Int(..) | LitKind::Float(..));
468+
if !matches!(lit.kind, LitKind::Int(..) | LitKind::Float(..));
469469
if let ExprKind::Path(_, p) = &lhs.kind;
470470
then {
471471
let mut all_simple = true;

0 commit comments

Comments
 (0)