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
+4 -13
View File
@@ -21,8 +21,8 @@
use std::{collections::HashMap, sync::Arc};
use crate::{columns, Database, DbHash, Transaction};
use parking_lot::Mutex;
use log::error;
use parking_lot::Mutex;
/// Offchain local storage
#[derive(Clone)]
@@ -33,8 +33,7 @@ pub struct LocalStorage {
impl std::fmt::Debug for LocalStorage {
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
fmt.debug_struct("LocalStorage")
.finish()
fmt.debug_struct("LocalStorage").finish()
}
}
@@ -49,10 +48,7 @@ impl LocalStorage {
/// Create offchain local storage with given `KeyValueDB` backend.
pub fn new(db: Arc<dyn Database<DbHash>>) -> Self {
Self {
db,
locks: Default::default(),
}
Self { db, locks: Default::default() }
}
}
@@ -118,11 +114,7 @@ impl sp_core::offchain::OffchainStorage for LocalStorage {
/// Concatenate the prefix and key to create an offchain key in the db.
pub(crate) fn concatenate_prefix_and_key(prefix: &[u8], key: &[u8]) -> Vec<u8> {
prefix
.iter()
.chain(key.into_iter())
.cloned()
.collect()
prefix.iter().chain(key.into_iter()).cloned().collect()
}
#[cfg(test)]
@@ -155,5 +147,4 @@ mod tests {
assert_eq!(storage.get(prefix, key), Some(b"asd".to_vec()));
assert!(storage.locks.lock().is_empty(), "Locks map should be empty!");
}
}