Skip to content

Commit 149b9d2

Browse files
clippy
1 parent 86c636a commit 149b9d2

File tree

1 file changed

+3
-3
lines changed
  • pallets/subtensor/src/subnets

1 file changed

+3
-3
lines changed

pallets/subtensor/src/subnets/uids.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ impl<T: Config> Pallet<T> {
1616
N: From<u8>,
1717
{
1818
move |vec: &mut Vec<N>| {
19-
if vec.len() > position as usize {
20-
vec[position as usize] = N::from(0);
21-
};
19+
if let Some(element) = vec.get_mut(position as usize) {
20+
*element = N::from(0);
21+
}
2222
}
2323
}
2424

0 commit comments

Comments
 (0)