Skip to content

Commit da30941

Browse files
committed
clippy
1 parent 8cc4049 commit da30941

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pallets/commitments/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ impl<T: Config> Pallet<T> {
586586

587587
const MAX_REVEALS: usize = 10;
588588
if existing_reveals.len() > MAX_REVEALS {
589-
let remove_count = existing_reveals.len() - MAX_REVEALS;
589+
let remove_count = existing_reveals.len().saturating_sub(MAX_REVEALS);
590590
existing_reveals.drain(0..remove_count);
591591
}
592592

pallets/commitments/src/tests.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,8 @@ fn revealed_commitments_keeps_only_10_newest_with_individual_single_field_commit
16861686
);
16871687
}
16881688

1689-
let revealed = RevealedCommitments::<Test>::get(netuid, who).unwrap();
1689+
let revealed =
1690+
RevealedCommitments::<Test>::get(netuid, who).expect("expected to not panic");
16901691
assert_eq!(
16911692
revealed.len(),
16921693
10,

0 commit comments

Comments
 (0)