Easy PR: Fix warnings from latest nightly (#14195)

* unneeded mut

* remove needless borrows
This commit is contained in:
Squirrel
2023-05-23 16:06:48 +01:00
committed by GitHub
parent 0fd0fb44d6
commit ea21a495f8
13 changed files with 31 additions and 33 deletions
+5 -5
View File
@@ -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!(