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
+7 -4
View File
@@ -18,11 +18,11 @@
//! The main database trait, allowing Substrate to store data persistently.
pub mod error;
mod mem;
mod kvdb;
mod mem;
pub use mem::MemDb;
pub use crate::kvdb::as_database;
pub use mem::MemDb;
/// An identifier for a column.
pub type ColumnId = u32;
@@ -118,10 +118,13 @@ impl<H> std::fmt::Debug for dyn Database<H> {
pub fn with_get<R, H: Clone + AsRef<[u8]>>(
db: &dyn Database<H>,
col: ColumnId,
key: &[u8], mut f: impl FnMut(&[u8]) -> R
key: &[u8],
mut f: impl FnMut(&[u8]) -> R,
) -> Option<R> {
let mut result: Option<R> = None;
let mut adapter = |k: &_| { result = Some(f(k)); };
let mut adapter = |k: &_| {
result = Some(f(k));
};
db.with_get(col, key, &mut adapter);
result
}