From 6c3bf7a2fc0a01b0598dece7deecc435425bfba8 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 8 Apr 2021 20:07:19 -0700 Subject: [PATCH] Ignore poor suggestion from branches_sharing_code lint https://github.com/rust-lang/rust-clippy/issues/7054 error: all if blocks contain the same code at the end --> serde_derive/src/de.rs:2160:5 | 2160 | / &fallthrough_arm_tokens 2161 | | }; | |_____^ | note: the lint level is defined here --> serde_derive/src/lib.rs:18:9 | 18 | #![deny(clippy::all, clippy::pedantic)] | ^^^^^^^^^^^ = note: `#[deny(clippy::branches_sharing_code)]` implied by `#[deny(clippy::all)]` = note: The end suggestion probably needs some adjustments to use the expression result correctly = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code help: consider moving the end statements out like this | 2160 | } 2161 | &fallthrough_arm_tokens; | --- serde_derive/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/serde_derive/src/lib.rs b/serde_derive/src/lib.rs index 446f1972..a63405b5 100644 --- a/serde_derive/src/lib.rs +++ b/serde_derive/src/lib.rs @@ -18,6 +18,8 @@ #![deny(clippy::all, clippy::pedantic)] // Ignored clippy lints #![allow( + // clippy false positive: https://github.com/rust-lang/rust-clippy/issues/7054 + clippy::branches_sharing_code, clippy::cognitive_complexity, clippy::enum_variant_names, // clippy bug: https://github.com/rust-lang/rust-clippy/issues/6797