Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Nov 18, 2024
1 parent 8d557c3 commit c553261
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pallets/nfts/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ benchmarks_instance_pallet! {
burn_item::<T, I>(i as u16);
}
for i in 0..l {
approve_collection::<T, I>(i as u32);
approve_collection::<T, I>(i);
}
let witness = Collection::<T, I>::get(collection).unwrap().destroy_witness();
}: _(SystemOrigin::Signed(caller), collection, witness)
Expand Down
2 changes: 1 addition & 1 deletion pallets/nfts/src/features/create_delete_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
let account_balance =
AccountBalance::<T, I>::mutate(collection, &mint_to, |balance| -> u32 {
balance.saturating_inc();
balance.clone()
*balance
});
if account_balance == 1 {
collection_details.item_holders.saturating_inc();
Expand Down
4 changes: 2 additions & 2 deletions pallets/nfts/src/features/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
let owner_balance =
AccountBalance::<T, I>::mutate(collection, &details.owner, |balance| -> u32 {
balance.saturating_dec();
balance.clone()
*balance
});
if owner_balance == 0 {
collection_details.item_holders.saturating_dec();
}
// Update account balance of the destination account.
let dest_balance = AccountBalance::<T, I>::mutate(collection, &dest, |balance| -> u32 {
balance.saturating_inc();
balance.clone()
*balance
});
if dest_balance == 1 {
collection_details.item_holders.saturating_inc();
Expand Down

0 comments on commit c553261

Please sign in to comment.