Run cargo fmt on the whole code base (#9394)

* Run cargo fmt on the whole code base

* Second run

* Add CI check

* Fix compilation

* More unnecessary braces

* Handle weights

* Use --all

* Use correct attributes...

* Fix UI tests

* AHHHHHHHHH

* 🤦

* Docs

* Fix compilation

* 🤷

* Please stop

* 🤦 x 2

* More

* make rustfmt.toml consistent with polkadot

Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
Bastian Köcher
2021-07-21 16:32:32 +02:00
committed by GitHub
parent d451c38c1c
commit 7b56ab15b4
1010 changed files with 53339 additions and 51208 deletions
@@ -17,7 +17,9 @@
//! Helper methods for npos-elections.
use crate::{Assignment, Error, IdentifierT, PerThing128, StakedAssignment, VoteWeight, WithApprovalOf};
use crate::{
Assignment, Error, IdentifierT, PerThing128, StakedAssignment, VoteWeight, WithApprovalOf,
};
use sp_arithmetic::PerThing;
use sp_std::prelude::*;
@@ -52,7 +54,8 @@ where
staked
.iter_mut()
.map(|a| {
a.try_normalize(stake_of(&a.who).into()).map_err(|err| Error::ArithmeticError(err))
a.try_normalize(stake_of(&a.who).into())
.map_err(|err| Error::ArithmeticError(err))
})
.collect::<Result<_, _>>()?;
Ok(staked)
@@ -113,14 +116,8 @@ mod tests {
assert_eq!(
staked,
vec![
StakedAssignment {
who: 1u32,
distribution: vec![(10u32, 50), (20, 50),]
},
StakedAssignment {
who: 2u32,
distribution: vec![(10u32, 33), (20, 67),]
}
StakedAssignment { who: 1u32, distribution: vec![(10u32, 50), (20, 50),] },
StakedAssignment { who: 2u32, distribution: vec![(10u32, 33), (20, 67),] }
]
);
}