From 149b9d21f2ef824c7862678baefec8cc0010222c Mon Sep 17 00:00:00 2001 From: Andreea Popescu Date: Tue, 27 Aug 2024 23:17:51 +0800 Subject: [PATCH] clippy --- pallets/subtensor/src/subnets/uids.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/subtensor/src/subnets/uids.rs b/pallets/subtensor/src/subnets/uids.rs index f509167cc..300556647 100644 --- a/pallets/subtensor/src/subnets/uids.rs +++ b/pallets/subtensor/src/subnets/uids.rs @@ -16,9 +16,9 @@ impl Pallet { N: From, { move |vec: &mut Vec| { - if vec.len() > position as usize { - vec[position as usize] = N::from(0); - }; + if let Some(element) = vec.get_mut(position as usize) { + *element = N::from(0); + } } }