From 4e834873d32a47ffef614970519c085d28dd1d28 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Sun, 1 Sep 2024 16:33:40 -0400 Subject: [PATCH] Lints from latest nightly We can't adopt it due to some issue with building the runtime, but these are good to have. --- crypto/ff-group-tests/src/prime_field.rs | 1 + substrate/coins/pallet/src/lib.rs | 2 +- substrate/dex/pallet/src/lib.rs | 6 +++++- substrate/economic-security/pallet/src/lib.rs | 7 ++++++- substrate/emissions/pallet/src/lib.rs | 8 ++++++-- substrate/genesis-liquidity/pallet/src/lib.rs | 7 ++++++- substrate/in-instructions/pallet/src/lib.rs | 7 ++++++- substrate/signals/pallet/src/lib.rs | 1 + substrate/validator-sets/pallet/src/lib.rs | 1 + 9 files changed, 33 insertions(+), 7 deletions(-) diff --git a/crypto/ff-group-tests/src/prime_field.rs b/crypto/ff-group-tests/src/prime_field.rs index 607f97383..ed072c599 100644 --- a/crypto/ff-group-tests/src/prime_field.rs +++ b/crypto/ff-group-tests/src/prime_field.rs @@ -31,6 +31,7 @@ pub fn test_from_u128() { } /// Test is_odd/is_even works. +/// /// This test assumes an odd modulus with oddness being determined by the least-significant bit. /// Accordingly, this test doesn't support fields alternatively defined. /// TODO: Improve in the future. diff --git a/substrate/coins/pallet/src/lib.rs b/substrate/coins/pallet/src/lib.rs index f6b055f70..a633ed070 100644 --- a/substrate/coins/pallet/src/lib.rs +++ b/substrate/coins/pallet/src/lib.rs @@ -13,7 +13,7 @@ impl AllowMint for () { } // TODO: Investigate why Substrate generates this -#[allow(clippy::cast_possible_truncation)] +#[allow(unreachable_patterns, clippy::cast_possible_truncation)] #[frame_support::pallet] pub mod pallet { use super::*; diff --git a/substrate/dex/pallet/src/lib.rs b/substrate/dex/pallet/src/lib.rs index 04ab02e6f..60a38926b 100644 --- a/substrate/dex/pallet/src/lib.rs +++ b/substrate/dex/pallet/src/lib.rs @@ -95,7 +95,11 @@ pub use types::*; pub use weights::WeightInfo; // TODO: Investigate why Substrate generates these -#[allow(clippy::cast_possible_truncation, clippy::no_effect_underscore_binding)] +#[allow( + unreachable_patterns, + clippy::cast_possible_truncation, + clippy::no_effect_underscore_binding +)] #[frame_support::pallet] pub mod pallet { use super::*; diff --git a/substrate/economic-security/pallet/src/lib.rs b/substrate/economic-security/pallet/src/lib.rs index cfcd573e5..65b827941 100644 --- a/substrate/economic-security/pallet/src/lib.rs +++ b/substrate/economic-security/pallet/src/lib.rs @@ -1,6 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[allow(clippy::cast_possible_truncation, clippy::no_effect_underscore_binding, clippy::empty_docs)] +#[allow( + unreachable_patterns, + clippy::cast_possible_truncation, + clippy::no_effect_underscore_binding, + clippy::empty_docs +)] #[frame_support::pallet] pub mod pallet { use frame_system::pallet_prelude::*; diff --git a/substrate/emissions/pallet/src/lib.rs b/substrate/emissions/pallet/src/lib.rs index fff77b5aa..400f89212 100644 --- a/substrate/emissions/pallet/src/lib.rs +++ b/substrate/emissions/pallet/src/lib.rs @@ -1,6 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[allow(clippy::cast_possible_truncation, clippy::no_effect_underscore_binding, clippy::empty_docs)] +#[allow( + unreachable_patterns, + clippy::cast_possible_truncation, + clippy::no_effect_underscore_binding, + clippy::empty_docs +)] #[frame_support::pallet] pub mod pallet { use super::*; @@ -8,7 +13,6 @@ pub mod pallet { use frame_support::{pallet_prelude::*, sp_runtime::SaturatedConversion}; use sp_std::{vec, vec::Vec, ops::Mul, collections::btree_map::BTreeMap}; - use sp_runtime; use coins_pallet::{Config as CoinsConfig, Pallet as Coins}; use dex_pallet::{Config as DexConfig, Pallet as Dex}; diff --git a/substrate/genesis-liquidity/pallet/src/lib.rs b/substrate/genesis-liquidity/pallet/src/lib.rs index b6d39bc3d..c9e4e4f41 100644 --- a/substrate/genesis-liquidity/pallet/src/lib.rs +++ b/substrate/genesis-liquidity/pallet/src/lib.rs @@ -1,6 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[allow(clippy::cast_possible_truncation, clippy::no_effect_underscore_binding, clippy::empty_docs)] +#[allow( + unreachable_patterns, + clippy::cast_possible_truncation, + clippy::no_effect_underscore_binding, + clippy::empty_docs +)] #[frame_support::pallet] pub mod pallet { use super::*; diff --git a/substrate/in-instructions/pallet/src/lib.rs b/substrate/in-instructions/pallet/src/lib.rs index d3652104c..f90ae4122 100644 --- a/substrate/in-instructions/pallet/src/lib.rs +++ b/substrate/in-instructions/pallet/src/lib.rs @@ -10,7 +10,12 @@ pub use in_instructions_primitives as primitives; use primitives::*; // TODO: Investigate why Substrate generates these -#[allow(clippy::cast_possible_truncation, clippy::no_effect_underscore_binding, clippy::empty_docs)] +#[allow( + unreachable_patterns, + clippy::cast_possible_truncation, + clippy::no_effect_underscore_binding, + clippy::empty_docs +)] #[frame_support::pallet] pub mod pallet { use sp_std::vec; diff --git a/substrate/signals/pallet/src/lib.rs b/substrate/signals/pallet/src/lib.rs index a869e7d4e..a682123d8 100644 --- a/substrate/signals/pallet/src/lib.rs +++ b/substrate/signals/pallet/src/lib.rs @@ -2,6 +2,7 @@ #[allow( deprecated, + unreachable_patterns, clippy::let_unit_value, clippy::cast_possible_truncation, clippy::ignored_unit_patterns diff --git a/substrate/validator-sets/pallet/src/lib.rs b/substrate/validator-sets/pallet/src/lib.rs index a404ae732..c2ba80a96 100644 --- a/substrate/validator-sets/pallet/src/lib.rs +++ b/substrate/validator-sets/pallet/src/lib.rs @@ -60,6 +60,7 @@ impl GetValidatorCount for MembershipProof { #[allow( deprecated, + unreachable_patterns, clippy::let_unit_value, clippy::cast_possible_truncation, clippy::ignored_unit_patterns