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

* unneeded mut

* remove needless borrows
This commit is contained in:
Squirrel authored and GitHub committed 2023-05-23 17:06:48 +02:00
1 parent 0fd0fb44d6
commit ea21a495f8
13 files changed
+31 -33

No files matched your search

+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.