Skip to content

Commit

Permalink
simplify check
Browse files Browse the repository at this point in the history
  • Loading branch information
enthusiastmartin committed Jul 13, 2023
1 parent 1b4de8d commit dcf2fb8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pallets/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -655,9 +654,12 @@ impl<T: Config> Pallet<T> {
}

fn is_owner(who: &T::AccountId, id: T::PositionItemId) -> bool {
match <T as pallet::Config>::NFTHandler::owner(&<T as pallet::Config>::NFTCollectionId::get(), &id) {
Some(owner) => owner == *who,
None => false,
if let Some(owner) =
<T as pallet::Config>::NFTHandler::owner(&<T as pallet::Config>::NFTCollectionId::get(), &id)
{
owner == *who
} else {
false
}
}

Expand Down

0 comments on commit dcf2fb8

Please sign in to comment.