Skip to content

Commit 39e661d

Browse files
authored
Merge pull request #1056 from opentensor/fix/clippy-warnings
Fix clippy warnings
2 parents e19501d + 5a04b94 commit 39e661d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: pallets/subtensor/src/epoch/math.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub fn check_vec_max_limited(vec: &[u16], max_limit: u16) -> bool {
150150
let mut vec_fixed: Vec<I32F32> = vec.iter().map(|e: &u16| I32F32::from_num(*e)).collect();
151151
inplace_normalize(&mut vec_fixed);
152152
let max_value: Option<&I32F32> = vec_fixed.iter().max();
153-
max_value.map_or(true, |v| *v <= max_limit_fixed)
153+
max_value.is_none_or(|v| *v <= max_limit_fixed)
154154
}
155155

156156
#[allow(dead_code)]
@@ -1229,7 +1229,7 @@ pub fn mat_ema_alpha_vec(
12291229
alpha: &[I32F32],
12301230
) -> Vec<Vec<I32F32>> {
12311231
// Check if the new matrix is empty or its first row is empty.
1232-
if new.is_empty() || new.first().map_or(true, |row| row.is_empty()) {
1232+
if new.is_empty() || new.first().is_none_or(|row| row.is_empty()) {
12331233
return vec![vec![]; 1];
12341234
}
12351235

Diff for: support/linting/src/pallet_index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'ast> syn::visit::Visit<'ast> for ConstructRuntimeVisitor {
3131
.path
3232
.segments
3333
.last()
34-
.map_or(false, |segment| segment.ident == "construct_runtime");
34+
.is_some_and(|segment| segment.ident == "construct_runtime");
3535

3636
if is_construct_runtime {
3737
let tokens = node.mac.tokens.clone();

0 commit comments

Comments
 (0)