about summary refs log tree commit diff
diff options
context:
space:
mode:
authorpro-grammer1 <1df0d0d3-eed4-45fc-bc60-43a85079f3f9@anonaddy.me>2021-01-17 18:21:58 +0000
committerpro-grammer1 <1df0d0d3-eed4-45fc-bc60-43a85079f3f9@anonaddy.me>2021-01-17 18:21:58 +0000
commitab155b14a27811c29e35bea76bfbf3845bc79fdf (patch)
tree8945c1c11828cd63bdec12711606d89fe4b8bf13
parent2af642da28109c96145c7a5613ae2ec37d359448 (diff)
downloadrust-ab155b14a27811c29e35bea76bfbf3845bc79fdf.tar.gz
rust-ab155b14a27811c29e35bea76bfbf3845bc79fdf.zip
Negate results of matches!
-rw-r--r--clippy_lints/src/write.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/write.rs b/clippy_lints/src/write.rs
index 6721639f724..60a9fb59cd2 100644
--- a/clippy_lints/src/write.rs
+++ b/clippy_lints/src/write.rs
@@ -443,7 +443,7 @@ impl Write {
                 return (Some(fmtstr), None);
             };
             match &token_expr.kind {
-                ExprKind::Lit(lit) if matches!(lit.kind, LitKind::Int(..) | LitKind::Float(..)) => {
+                ExprKind::Lit(lit) if !matches!(lit.kind, LitKind::Int(..) | LitKind::Float(..)) => {
                     let mut all_simple = true;
                     let mut seen = false;
                     for arg in &args {
@@ -465,7 +465,7 @@ impl Write {
                 ExprKind::Assign(lhs, rhs, _) => {
                     if_chain! {
                         if let ExprKind::Lit(ref lit) = rhs.kind;
-                        if matches!(lit.kind, LitKind::Int(..) | LitKind::Float(..));
+                        if !matches!(lit.kind, LitKind::Int(..) | LitKind::Float(..));
                         if let ExprKind::Path(_, p) = &lhs.kind;
                         then {
                             let mut all_simple = true;