mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 16:57:58 +00:00
Fix clippy lints behind feature gates and add new CI step all features (#2569)
Many clippy lints usually enforced by `-Dcomplexity` and `-Dcorrectness` are not caught by CI as they are gated by `features`, like `runtime-benchmarks`, while the clippy CI job runs with only the default features for all targets. This PR also adds a CI step to run clippy with `--all-features` to ensure the code quality is maintained behind feature gates from now on. To improve local development, clippy lints are downgraded to warnings, but they still will result in an error at CI due to the `-Dwarnings` rustflag. --------- Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
This commit is contained in:
@@ -105,7 +105,7 @@ pub mod v3 {
|
||||
// Check that no agenda overflows `MaxScheduledPerBlock`.
|
||||
let max_scheduled_per_block = T::MaxScheduledPerBlock::get() as usize;
|
||||
for (block_number, agenda) in Agenda::<T>::iter() {
|
||||
if agenda.iter().cloned().filter_map(|s| s).count() > max_scheduled_per_block {
|
||||
if agenda.iter().cloned().flatten().count() > max_scheduled_per_block {
|
||||
log::error!(
|
||||
target: TARGET,
|
||||
"Would truncate agenda of block {:?} from {} items to {} items.",
|
||||
@@ -119,7 +119,7 @@ pub mod v3 {
|
||||
// Check that bounding the calls will not overflow `MAX_LENGTH`.
|
||||
let max_length = T::Preimages::MAX_LENGTH as usize;
|
||||
for (block_number, agenda) in Agenda::<T>::iter() {
|
||||
for schedule in agenda.iter().cloned().filter_map(|s| s) {
|
||||
for schedule in agenda.iter().cloned().flatten() {
|
||||
match schedule.call {
|
||||
frame_support::traits::schedule::MaybeHashed::Value(call) => {
|
||||
let l = call.using_encoded(|c| c.len());
|
||||
@@ -362,7 +362,7 @@ mod test {
|
||||
Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: Some(vec![i as u8; 320]),
|
||||
priority: 123,
|
||||
call: MaybeHashed::Hash(undecodable_hash.clone()),
|
||||
call: MaybeHashed::Hash(undecodable_hash),
|
||||
maybe_periodic: Some((4u64, 20)),
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
|
||||
Reference in New Issue
Block a user