diff --git a/substrate/client/api/src/light.rs b/substrate/client/api/src/light.rs index fc9b6dc6fd..c0bebc1740 100644 --- a/substrate/client/api/src/light.rs +++ b/substrate/client/api/src/light.rs @@ -21,10 +21,10 @@ use std::collections::{BTreeMap, HashMap}; use std::future::Future; use sp_runtime::{ - traits::{ - Block as BlockT, Header as HeaderT, NumberFor, - }, - generic::BlockId + traits::{ + Block as BlockT, Header as HeaderT, NumberFor, + }, + generic::BlockId }; use sp_core::ChangesTrieConfigurationRange; use sp_state_machine::StorageProof; @@ -307,8 +307,8 @@ pub trait RemoteBlockchain: Send + Sync { pub mod tests { use futures::future::Ready; use parking_lot::Mutex; - use sp_blockchain::Error as ClientError; - use sp_test_primitives::{Block, Header, Extrinsic}; + use sp_blockchain::Error as ClientError; + use sp_test_primitives::{Block, Header, Extrinsic}; use super::*; pub type OkCallFetcher = Mutex>; diff --git a/substrate/client/consensus/aura/src/lib.rs b/substrate/client/consensus/aura/src/lib.rs index 270bd19422..4b107d87d5 100644 --- a/substrate/client/consensus/aura/src/lib.rs +++ b/substrate/client/consensus/aura/src/lib.rs @@ -65,7 +65,7 @@ use sp_timestamp::{ use sc_telemetry::{telemetry, CONSENSUS_TRACE, CONSENSUS_DEBUG, CONSENSUS_INFO}; use sc_consensus_slots::{ - CheckedHeader, SlotWorker, SlotInfo, SlotCompatible, StorageChanges, check_equivocation, + CheckedHeader, SlotWorker, SlotInfo, SlotCompatible, StorageChanges, check_equivocation, }; use sc_keystore::KeyStorePtr; diff --git a/substrate/client/executor/src/integration_tests/mod.rs b/substrate/client/executor/src/integration_tests/mod.rs index ef8171e5ad..02a5897ea4 100644 --- a/substrate/client/executor/src/integration_tests/mod.rs +++ b/substrate/client/executor/src/integration_tests/mod.rs @@ -72,7 +72,7 @@ fn call_not_existing_function(wasm_method: WasmExecutionMethod) { let mut ext = TestExternalities::default(); let mut ext = ext.ext(); - match call_in_wasm( + match call_in_wasm( "test_calling_missing_external", &[], wasm_method, diff --git a/substrate/client/rpc/src/state/state_light.rs b/substrate/client/rpc/src/state/state_light.rs index 482eb0723f..cc3d1a4951 100644 --- a/substrate/client/rpc/src/state/state_light.rs +++ b/substrate/client/rpc/src/state/state_light.rs @@ -708,7 +708,7 @@ fn ignore_error(future: F) -> impl std::future::Future, number: u64) { fn benchmark_main(c: &mut Criterion) { - c.bench_function("sequential 50 tx", |b| { + c.bench_function("sequential 50 tx", |b| { b.iter(|| { bench_configured(Pool::new(Default::default(), TestApi::new_dependant().into()), 50); }); diff --git a/substrate/frame/contracts/src/wasm/prepare.rs b/substrate/frame/contracts/src/wasm/prepare.rs index 39e1fca79d..ba934f353e 100644 --- a/substrate/frame/contracts/src/wasm/prepare.rs +++ b/substrate/frame/contracts/src/wasm/prepare.rs @@ -76,7 +76,7 @@ impl<'a> ContractModule<'a> { /// Ensures that tables declared in the module are not too big. fn ensure_table_size_limit(&self, limit: u32) -> Result<(), &'static str> { - if let Some(table_section) = self.module.table_section() { + if let Some(table_section) = self.module.table_section() { // In Wasm MVP spec, there may be at most one table declared. Double check this // explicitly just in case the Wasm version changes. if table_section.entries().len() > 1 { diff --git a/substrate/primitives/arithmetic/benches/bench.rs b/substrate/primitives/arithmetic/benches/bench.rs index 1025e883ef..1dbcf260af 100644 --- a/substrate/primitives/arithmetic/benches/bench.rs +++ b/substrate/primitives/arithmetic/benches/bench.rs @@ -73,8 +73,8 @@ fn bench_division(c: &mut Criterion) { } criterion_group!{ - name = benches; - config = Criterion::default(); - targets = bench_addition, bench_subtraction, bench_multiplication, bench_division + name = benches; + config = Criterion::default(); + targets = bench_addition, bench_subtraction, bench_multiplication, bench_division } criterion_main!(benches); diff --git a/substrate/primitives/core/benches/bench.rs b/substrate/primitives/core/benches/bench.rs index 36728742d8..7096cd6c19 100644 --- a/substrate/primitives/core/benches/bench.rs +++ b/substrate/primitives/core/benches/bench.rs @@ -87,8 +87,8 @@ fn bench_ed25519(c: &mut Criterion) { } criterion_group!{ - name = benches; - config = Criterion::default().warm_up_time(Duration::from_millis(500)).without_plots(); - targets = bench_hash_128_fix_size, bench_hash_128_dyn_size, bench_ed25519 + name = benches; + config = Criterion::default().warm_up_time(Duration::from_millis(500)).without_plots(); + targets = bench_hash_128_fix_size, bench_hash_128_dyn_size, bench_ed25519 } criterion_main!(benches); diff --git a/substrate/primitives/phragmen/benches/phragmen.rs b/substrate/primitives/phragmen/benches/phragmen.rs index 7bebda564e..aa99e6f384 100644 --- a/substrate/primitives/phragmen/benches/phragmen.rs +++ b/substrate/primitives/phragmen/benches/phragmen.rs @@ -158,8 +158,8 @@ fn do_phragmen( macro_rules! phragmen_benches { ($($name:ident: $tup:expr,)*) => { $( - #[bench] - fn $name(b: &mut Bencher) { + #[bench] + fn $name(b: &mut Bencher) { let (v, n, t, e, eq_iter, eq_tol) = $tup; println!("----------------------"); println!( @@ -168,8 +168,8 @@ macro_rules! phragmen_benches { v, n, e, e * n, t, eq_iter, eq_tol, ); do_phragmen(b, v, n, t, e, eq_iter, eq_tol); - } - )* + } + )* } } diff --git a/substrate/primitives/runtime/src/generic/era.rs b/substrate/primitives/runtime/src/generic/era.rs index 238130db00..37b4b495fe 100644 --- a/substrate/primitives/runtime/src/generic/era.rs +++ b/substrate/primitives/runtime/src/generic/era.rs @@ -47,14 +47,14 @@ pub enum Era { } /* -E.g. with period == 4: -0 10 20 30 40 -0123456789012345678901234567890123456789012 - |...| - authored -/ \- expiry -phase = 1 -n = Q(current - phase, period) + phase -*/ + * E.g. with period == 4: + * 0 10 20 30 40 + * 0123456789012345678901234567890123456789012 + * |...| + * authored -/ \- expiry + * phase = 1 + * n = Q(current - phase, period) + phase + */ impl Era { /// Create a new era based on a period (which should be a power of two between 4 and 65536 inclusive) /// and a block number on which it should start (or, for long periods, be shortly after the start). diff --git a/substrate/primitives/state-machine/src/stats.rs b/substrate/primitives/state-machine/src/stats.rs index 38286be545..aa69b5be9d 100644 --- a/substrate/primitives/state-machine/src/stats.rs +++ b/substrate/primitives/state-machine/src/stats.rs @@ -21,42 +21,42 @@ use std::time::{Instant, Duration}; /// Measured count of operations and total bytes. #[derive(Clone, Debug, Default)] pub struct UsageUnit { - /// Number of operations. - pub ops: u64, - /// Number of bytes. - pub bytes: u64, + /// Number of operations. + pub ops: u64, + /// Number of bytes. + pub bytes: u64, } /// Usage statistics for state backend. #[derive(Clone, Debug)] pub struct UsageInfo { - /// Read statistics (total). - pub reads: UsageUnit, - /// Write statistics. - pub writes: UsageUnit, - /// Cache read statistics. - pub cache_reads: UsageUnit, - /// Memory used. - pub memory: usize, + /// Read statistics (total). + pub reads: UsageUnit, + /// Write statistics. + pub writes: UsageUnit, + /// Cache read statistics. + pub cache_reads: UsageUnit, + /// Memory used. + pub memory: usize, - /// Moment at which current statistics has been started being collected. - pub started: Instant, - /// Timespan of the statistics. - pub span: Duration, + /// Moment at which current statistics has been started being collected. + pub started: Instant, + /// Timespan of the statistics. + pub span: Duration, } impl UsageInfo { - /// Empty statistics. - /// - /// Means no data was collected. - pub fn empty() -> Self { - Self { - reads: UsageUnit::default(), - writes: UsageUnit::default(), - cache_reads: UsageUnit::default(), - memory: 0, - started: Instant::now(), - span: Default::default(), - } - } -} \ No newline at end of file + /// Empty statistics. + /// + /// Means no data was collected. + pub fn empty() -> Self { + Self { + reads: UsageUnit::default(), + writes: UsageUnit::default(), + cache_reads: UsageUnit::default(), + memory: 0, + started: Instant::now(), + span: Default::default(), + } + } +}