From dcf2fb8113811292bf5186de8b3ebe86479c25f2 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 13 Jul 2023 11:07:33 +0200 Subject: [PATCH] simplify check --- pallets/staking/src/lib.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pallets/staking/src/lib.rs b/pallets/staking/src/lib.rs index 006370d66..c337fe113 100644 --- a/pallets/staking/src/lib.rs +++ b/pallets/staking/src/lib.rs @@ -25,7 +25,6 @@ use crate::traits::{ActionData, DemocracyReferendum, PayablePercentage, VestingD use crate::types::{Action, Balance, Period, Point, Position, StakingData, Voting}; use frame_support::ensure; use frame_support::{ - defensive, pallet_prelude::DispatchResult, pallet_prelude::*, traits::nonfungibles::{Create, Inspect, InspectEnumerable, Mutate}, @@ -655,9 +654,12 @@ impl Pallet { } fn is_owner(who: &T::AccountId, id: T::PositionItemId) -> bool { - match ::NFTHandler::owner(&::NFTCollectionId::get(), &id) { - Some(owner) => owner == *who, - None => false, + if let Some(owner) = + ::NFTHandler::owner(&::NFTCollectionId::get(), &id) + { + owner == *who + } else { + false } }