Negate results of matches!

This commit is contained in:
pro-grammer1 2021-01-17 18:21:58 +00:00
parent 2af642da28
commit ab155b14a2

View File

@ -443,7 +443,7 @@ fn check_tts<'a>(&self, cx: &EarlyContext<'a>, tts: TokenStream, is_write: bool)
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 @@ fn check_tts<'a>(&self, cx: &EarlyContext<'a>, tts: TokenStream, is_write: bool)
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;