From fe75d1ccbb6ec05c03f9d6bd234d193ce9623004 Mon Sep 17 00:00:00 2001 From: Greg Zaitsev Date: Tue, 3 Dec 2024 18:46:22 -0500 Subject: [PATCH 1/3] Fix clippy warnings --- pallets/subtensor/src/epoch/math.rs | 4 ++-- support/linting/src/pallet_index.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/subtensor/src/epoch/math.rs b/pallets/subtensor/src/epoch/math.rs index 027966f92..57d0f6b6f 100644 --- a/pallets/subtensor/src/epoch/math.rs +++ b/pallets/subtensor/src/epoch/math.rs @@ -150,7 +150,7 @@ pub fn check_vec_max_limited(vec: &[u16], max_limit: u16) -> bool { let mut vec_fixed: Vec = vec.iter().map(|e: &u16| I32F32::from_num(*e)).collect(); inplace_normalize(&mut vec_fixed); let max_value: Option<&I32F32> = vec_fixed.iter().max(); - max_value.map_or(true, |v| *v <= max_limit_fixed) + max_value.is_none_or(|v| *v <= max_limit_fixed) } #[allow(dead_code)] @@ -1229,7 +1229,7 @@ pub fn mat_ema_alpha_vec( alpha: &[I32F32], ) -> Vec> { // Check if the new matrix is empty or its first row is empty. - if new.is_empty() || new.first().map_or(true, |row| row.is_empty()) { + if new.is_empty() || new.first().is_none_or(|row| row.is_empty()) { return vec![vec![]; 1]; } diff --git a/support/linting/src/pallet_index.rs b/support/linting/src/pallet_index.rs index 8ed3627d5..072f632b7 100644 --- a/support/linting/src/pallet_index.rs +++ b/support/linting/src/pallet_index.rs @@ -31,7 +31,7 @@ impl<'ast> syn::visit::Visit<'ast> for ConstructRuntimeVisitor { .path .segments .last() - .map_or(false, |segment| segment.ident == "construct_runtime"); + .is_some_and(|segment| segment.ident == "construct_runtime"); if is_construct_runtime { let tokens = node.mac.tokens.clone(); From 7c16b02779d9b0c162e965d1e3d549449b2b6373 Mon Sep 17 00:00:00 2001 From: Greg Zaitsev Date: Tue, 3 Dec 2024 18:49:20 -0500 Subject: [PATCH 2/3] Bump spec version --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index a38b5071d..777111bdc 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -220,7 +220,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 213, + spec_version: 214, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From 5a04b94a9ae52b5209cab89f750fa49872a3fa26 Mon Sep 17 00:00:00 2001 From: Greg Zaitsev Date: Tue, 3 Dec 2024 19:04:24 -0500 Subject: [PATCH 3/3] Revert "Bump spec version" This reverts commit 7c16b02779d9b0c162e965d1e3d549449b2b6373. --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 777111bdc..a38b5071d 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -220,7 +220,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 214, + spec_version: 213, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,