]> git.lizzy.rs Git - rust.git/commitdiff
Run tests/ui/update-all-references.sh and refactor match into matches!
authorpro-grammer1 <1df0d0d3-eed4-45fc-bc60-43a85079f3f9@anonaddy.me>
Sun, 17 Jan 2021 08:48:37 +0000 (08:48 +0000)
committerpro-grammer1 <1df0d0d3-eed4-45fc-bc60-43a85079f3f9@anonaddy.me>
Sun, 17 Jan 2021 08:48:37 +0000 (08:48 +0000)
clippy_lints/src/write.rs

index 78d23e1e0ef4393838f794259dd4116d7e349519..52118a56bb65d3f83678a83a81506c56ab7a8803 100644 (file)
@@ -470,10 +470,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 match lit.kind {
-                            LitKind::Int(_, _) | LitKind::Float(_, _) => false,
-                            _ => true,
-                        };
+                        if matches!(lit.kind, LitKind::Int(..) | LitKind::Float(..));
                         if let ExprKind::Path(_, p) = &lhs.kind;
                         then {
                             let mut all_simple = true;