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
+1 -3
View File
@@ -1006,9 +1006,7 @@ pub mod pallet {
// Note: in case there is no current era it is fine to bond one era more.
let era = Self::current_era().unwrap_or(0) + T::BondingDuration::get();
if let Some(mut chunk) =
ledger.unlocking.last_mut().filter(|chunk| chunk.era == era)
{
if let Some(chunk) = ledger.unlocking.last_mut().filter(|chunk| chunk.era == era) {
// To keep the chunk count down, we only keep one chunk per era. Since
// `unlocking` is a FiFo queue, if a chunk exists for `era` we know that it will
// be the last one.