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
@@ -18,10 +18,9 @@
//! Shared logic between on-chain and off-chain components used for slashing using an off-chain
//! worker.
use super::SessionIndex;
use sp_std::prelude::*;
use codec::Encode;
use sp_std::prelude::*;
pub(super) const PREFIX: &[u8] = b"session_historical";
pub(super) const LAST_PRUNE: &[u8] = b"session_historical_last_prune";
@@ -30,10 +29,11 @@ pub(super) const LAST_PRUNE: &[u8] = b"session_historical_last_prune";
pub(super) fn derive_key<P: AsRef<[u8]>>(prefix: P, session_index: SessionIndex) -> Vec<u8> {
let prefix: &[u8] = prefix.as_ref();
session_index.using_encoded(|encoded_session_index| {
prefix.into_iter()
prefix
.into_iter()
.chain(b"/".into_iter())
.chain(encoded_session_index.into_iter())
.copied()
.collect::<Vec<u8>>()
})
}
}