mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 13:57:58 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user