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
@@ -28,7 +28,7 @@
//! [here](https://docs.rs/honggfuzz/).
use honggfuzz::fuzz;
use sp_arithmetic::{FixedPointNumber, FixedI64, traits::Saturating};
use sp_arithmetic::{traits::Saturating, FixedI64, FixedPointNumber};
fn main() {
loop {
@@ -38,7 +38,8 @@ fn main() {
// Check `from_rational` and division are consistent.
if y != 0 {
let f1 = FixedI64::saturating_from_integer(x) / FixedI64::saturating_from_integer(y);
let f1 =
FixedI64::saturating_from_integer(x) / FixedI64::saturating_from_integer(y);
let f2 = FixedI64::saturating_from_rational(x, y);
assert_eq!(f1.into_inner(), f2.into_inner());
}
@@ -75,7 +76,8 @@ fn main() {
let a = FixedI64::saturating_from_rational(2, 5);
let b = a.saturating_mul_acc_int(x);
let xx = FixedI64::saturating_from_integer(x);
let d = a.saturating_mul(xx).saturating_add(xx).into_inner() as i128 / FixedI64::accuracy() as i128;
let d = a.saturating_mul(xx).saturating_add(xx).into_inner() as i128 /
FixedI64::accuracy() as i128;
assert_eq!(b, d);
});
}