Add workspace lints

This commit is contained in:
Luke Parker
2023-12-16 20:54:24 -05:00
parent c40ce00955
commit ea3af28139
122 changed files with 329 additions and 128 deletions

View File

@@ -15,6 +15,9 @@ rustdoc-args = ["--cfg", "docsrs"]
[package.metadata.cargo-machete]
ignored = ["scale", "scale-info"]
[lints]
workspace = true
[dependencies]
hashbrown = { version = "0.14", default-features = false, features = ["ahash", "inline-more"] }

View File

@@ -53,11 +53,16 @@ impl<T: pallet::Config> GetValidatorCount for MembershipProof<T> {
// rely on it and Substrate only relies on it to offer economic calculations we also don't rely
// on
fn validator_count(&self) -> u32 {
Babe::<T>::authorities().len() as u32
u32::try_from(Babe::<T>::authorities().len()).unwrap()
}
}
#[allow(deprecated, clippy::let_unit_value)] // TODO
#[allow(
deprecated,
clippy::let_unit_value,
clippy::cast_possible_truncation,
clippy::ignored_unit_patterns
)] // TODO
#[frame_support::pallet]
pub mod pallet {
use super::*;
@@ -717,7 +722,7 @@ pub mod pallet {
None,
),
WeakBoundedVec::force_from(
next_validators.iter().cloned().map(|(id, w)| (BabeAuthorityId::from(id), w)).collect(),
next_validators.iter().copied().map(|(id, w)| (BabeAuthorityId::from(id), w)).collect(),
None,
),
Some(session),

View File

@@ -12,6 +12,9 @@ rust-version = "1.74"
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[lints]
workspace = true
[dependencies]
zeroize = { version = "^1.5", features = ["derive"], optional = true }