mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 01:51:02 +00:00
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:
@@ -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),] }
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user