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
+11 -9
View File
@@ -18,9 +18,9 @@
//! Substrate system API helpers.
use sc_chain_spec::{ChainType, Properties};
use serde::{Deserialize, Serialize};
use std::fmt;
use serde::{Serialize, Deserialize};
use sc_chain_spec::{Properties, ChainType};
/// Running node's static details.
#[derive(Clone, Debug)]
@@ -53,9 +53,7 @@ pub struct Health {
impl fmt::Display for Health {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "{} peers ({})", self.peers, if self.is_syncing {
"syncing"
} else { "idle" })
write!(fmt, "{} peers ({})", self.peers, if self.is_syncing { "syncing" } else { "idle" })
}
}
@@ -107,7 +105,8 @@ mod tests {
peers: 1,
is_syncing: false,
should_have_peers: true,
}).unwrap(),
})
.unwrap(),
r#"{"peers":1,"isSyncing":false,"shouldHavePeers":true}"#,
);
}
@@ -120,7 +119,8 @@ mod tests {
roles: "a".into(),
best_hash: 5u32,
best_number: 6u32,
}).unwrap(),
})
.unwrap(),
r#"{"peerId":"2","roles":"a","bestHash":5,"bestNumber":6}"#,
);
}
@@ -132,7 +132,8 @@ mod tests {
starting_block: 12u32,
current_block: 50u32,
highest_block: Some(128u32),
}).unwrap(),
})
.unwrap(),
r#"{"startingBlock":12,"currentBlock":50,"highestBlock":128}"#,
);
@@ -141,7 +142,8 @@ mod tests {
starting_block: 12u32,
current_block: 50u32,
highest_block: None,
}).unwrap(),
})
.unwrap(),
r#"{"startingBlock":12,"currentBlock":50}"#,
);
}