From 92eb92d1dd5c3b28038da381f569f3dadbc50183 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 1 Dec 2020 12:20:57 +1000 Subject: [PATCH] Disable the nightly clippy unnecessary_wraps lint (#1403) It seems to be a bit broken - some of our functions return `Result` for consistency with similar functions. But the lint picks them up anyway. --- zebra-chain/src/lib.rs | 2 ++ zebra-consensus/src/lib.rs | 3 +++ zebra-network/src/lib.rs | 3 +++ zebra-script/src/lib.rs | 3 +++ zebra-state/src/lib.rs | 2 ++ zebra-test/src/lib.rs | 1 + zebrad/tests/acceptance.rs | 3 ++- 7 files changed, 16 insertions(+), 1 deletion(-) diff --git a/zebra-chain/src/lib.rs b/zebra-chain/src/lib.rs index a7c269fdc..5a317df4c 100644 --- a/zebra-chain/src/lib.rs +++ b/zebra-chain/src/lib.rs @@ -8,8 +8,10 @@ #![doc(html_root_url = "https://doc.zebra.zfnd.org/zebra_chain")] // #![deny(missing_docs)] #![allow(clippy::try_err)] +// Disable some broken or unwanted clippy nightly lints #![allow(clippy::unknown_clippy_lints)] #![allow(clippy::from_iter_instead_of_collect)] +#![allow(clippy::unnecessary_wraps)] #[macro_use] extern crate serde; diff --git a/zebra-consensus/src/lib.rs b/zebra-consensus/src/lib.rs index 4c87fddfe..f18397d2a 100644 --- a/zebra-consensus/src/lib.rs +++ b/zebra-consensus/src/lib.rs @@ -36,6 +36,9 @@ // Re-enable this after cleaning the API surface. //#![deny(missing_docs)] #![allow(clippy::try_err)] +// Disable some broken or unwanted clippy nightly lints +#![allow(clippy::unknown_clippy_lints)] +#![allow(clippy::unnecessary_wraps)] mod block; mod checkpoint; diff --git a/zebra-network/src/lib.rs b/zebra-network/src/lib.rs index b7e09a239..d6dca394c 100644 --- a/zebra-network/src/lib.rs +++ b/zebra-network/src/lib.rs @@ -38,6 +38,9 @@ // Tracing causes false positives on this lint: // https://github.com/tokio-rs/tracing/issues/553 #![allow(clippy::cognitive_complexity)] +// Disable some broken or unwanted clippy nightly lints +#![allow(clippy::unknown_clippy_lints)] +#![allow(clippy::unnecessary_wraps)] #[macro_use] extern crate pin_project; diff --git a/zebra-script/src/lib.rs b/zebra-script/src/lib.rs index a5d4946cf..1ec457696 100644 --- a/zebra-script/src/lib.rs +++ b/zebra-script/src/lib.rs @@ -2,6 +2,9 @@ #![doc(html_favicon_url = "https://www.zfnd.org/images/zebra-favicon-128.png")] #![doc(html_logo_url = "https://www.zfnd.org/images/zebra-icon.png")] #![doc(html_root_url = "https://doc.zebra.zfnd.org/zebra_script")] +// Disable some broken or unwanted clippy nightly lints +#![allow(clippy::unknown_clippy_lints)] +#![allow(clippy::unnecessary_wraps)] use displaydoc::Display; #[cfg(windows)] diff --git a/zebra-state/src/lib.rs b/zebra-state/src/lib.rs index 2558a62d0..635e72d16 100644 --- a/zebra-state/src/lib.rs +++ b/zebra-state/src/lib.rs @@ -5,8 +5,10 @@ #![doc(html_root_url = "https://doc.zebra.zfnd.org/zebra_state")] #![warn(missing_docs)] #![allow(clippy::try_err)] +// Disable some broken or unwanted clippy nightly lints #![allow(clippy::unknown_clippy_lints)] #![allow(clippy::field_reassign_with_default)] +#![allow(clippy::unnecessary_wraps)] mod config; mod constants; diff --git a/zebra-test/src/lib.rs b/zebra-test/src/lib.rs index e45eb4a81..e16cfb50d 100644 --- a/zebra-test/src/lib.rs +++ b/zebra-test/src/lib.rs @@ -1,5 +1,6 @@ //! Miscellaneous test code for Zebra. +// Disable some broken or unwanted clippy nightly lints #![allow(clippy::unknown_clippy_lints)] #![allow(clippy::from_iter_instead_of_collect)] // Each lazy_static variable uses additional recursion diff --git a/zebrad/tests/acceptance.rs b/zebrad/tests/acceptance.rs index db34bac93..5dcb623d3 100644 --- a/zebrad/tests/acceptance.rs +++ b/zebrad/tests/acceptance.rs @@ -14,9 +14,10 @@ #![warn(warnings, missing_docs, trivial_casts, unused_qualifications)] #![forbid(unsafe_code)] #![allow(dead_code)] -#![allow(clippy::field_reassign_with_default)] #![allow(clippy::try_err)] +// Disable some broken or unwanted clippy nightly lints #![allow(clippy::unknown_clippy_lints)] +#![allow(clippy::field_reassign_with_default)] use color_eyre::eyre::Result; use eyre::WrapErr;