mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 22:51:13 +00:00
Easy PR: Fix warnings from latest nightly (#14195)
* unneeded mut * remove needless borrows
This commit is contained in:
@@ -361,7 +361,7 @@ pub mod pallet {
|
||||
) -> DispatchResult {
|
||||
let max_amount = T::SpendOrigin::ensure_origin(origin)?;
|
||||
Bounties::<T, I>::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult {
|
||||
let mut bounty = maybe_bounty.as_mut().ok_or(Error::<T, I>::InvalidIndex)?;
|
||||
let bounty = maybe_bounty.as_mut().ok_or(Error::<T, I>::InvalidIndex)?;
|
||||
ensure!(
|
||||
bounty.value <= max_amount,
|
||||
pallet_treasury::Error::<T, I>::InsufficientPermission
|
||||
@@ -396,7 +396,7 @@ pub mod pallet {
|
||||
|
||||
let curator = T::Lookup::lookup(curator)?;
|
||||
Bounties::<T, I>::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult {
|
||||
let mut bounty = maybe_bounty.as_mut().ok_or(Error::<T, I>::InvalidIndex)?;
|
||||
let bounty = maybe_bounty.as_mut().ok_or(Error::<T, I>::InvalidIndex)?;
|
||||
ensure!(
|
||||
bounty.value <= max_amount,
|
||||
pallet_treasury::Error::<T, I>::InsufficientPermission
|
||||
@@ -444,7 +444,7 @@ pub mod pallet {
|
||||
.or_else(|_| T::RejectOrigin::ensure_origin(origin).map(|_| None))?;
|
||||
|
||||
Bounties::<T, I>::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult {
|
||||
let mut bounty = maybe_bounty.as_mut().ok_or(Error::<T, I>::InvalidIndex)?;
|
||||
let bounty = maybe_bounty.as_mut().ok_or(Error::<T, I>::InvalidIndex)?;
|
||||
|
||||
let slash_curator = |curator: &T::AccountId,
|
||||
curator_deposit: &mut BalanceOf<T, I>| {
|
||||
@@ -527,7 +527,7 @@ pub mod pallet {
|
||||
let signer = ensure_signed(origin)?;
|
||||
|
||||
Bounties::<T, I>::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult {
|
||||
let mut bounty = maybe_bounty.as_mut().ok_or(Error::<T, I>::InvalidIndex)?;
|
||||
let bounty = maybe_bounty.as_mut().ok_or(Error::<T, I>::InvalidIndex)?;
|
||||
|
||||
match bounty.status {
|
||||
BountyStatus::CuratorProposed { ref curator } => {
|
||||
@@ -571,7 +571,7 @@ pub mod pallet {
|
||||
let beneficiary = T::Lookup::lookup(beneficiary)?;
|
||||
|
||||
Bounties::<T, I>::try_mutate_exists(bounty_id, |maybe_bounty| -> DispatchResult {
|
||||
let mut bounty = maybe_bounty.as_mut().ok_or(Error::<T, I>::InvalidIndex)?;
|
||||
let bounty = maybe_bounty.as_mut().ok_or(Error::<T, I>::InvalidIndex)?;
|
||||
|
||||
// Ensure no active child bounties before processing the call.
|
||||
ensure!(
|
||||
|
||||
Reference in New Issue
Block a user