mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 12:07:57 +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,8 +18,8 @@
|
||||
|
||||
//! Provides a generic wrapper around shared data. See [`SharedData`] for more information.
|
||||
|
||||
use parking_lot::{Condvar, MappedMutexGuard, Mutex, MutexGuard};
|
||||
use std::sync::Arc;
|
||||
use parking_lot::{Mutex, MappedMutexGuard, Condvar, MutexGuard};
|
||||
|
||||
/// Created by [`SharedDataLocked::release_mutex`].
|
||||
///
|
||||
@@ -75,8 +75,7 @@ impl<'a, T> SharedDataLocked<'a, T> {
|
||||
/// Release the mutex, but keep the shared data locked.
|
||||
pub fn release_mutex(mut self) -> SharedDataLockedUpgradable<T> {
|
||||
SharedDataLockedUpgradable {
|
||||
shared_data: self.shared_data.take()
|
||||
.expect("`shared_data` is only taken on drop; qed"),
|
||||
shared_data: self.shared_data.take().expect("`shared_data` is only taken on drop; qed"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +131,7 @@ struct SharedDataInner<T> {
|
||||
/// # Example
|
||||
///
|
||||
/// ```
|
||||
///# use sc_consensus::shared_data::SharedData;
|
||||
/// # use sc_consensus::shared_data::SharedData;
|
||||
///
|
||||
/// let shared_data = SharedData::new(String::from("hello world"));
|
||||
///
|
||||
@@ -174,10 +173,7 @@ pub struct SharedData<T> {
|
||||
|
||||
impl<T> Clone for SharedData<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
inner: self.inner.clone(),
|
||||
cond_var: self.cond_var.clone(),
|
||||
}
|
||||
Self { inner: self.inner.clone(), cond_var: self.cond_var.clone() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,10 +224,7 @@ impl<T> SharedData<T> {
|
||||
debug_assert!(!guard.locked);
|
||||
guard.locked = true;
|
||||
|
||||
SharedDataLocked {
|
||||
inner: guard,
|
||||
shared_data: Some(self.clone()),
|
||||
}
|
||||
SharedDataLocked { inner: guard, shared_data: Some(self.clone()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user