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
@@ -16,8 +16,7 @@
// limitations under the License.
/// Contains the inherents for the AURA module
use sp_inherents::{InherentIdentifier, InherentData, Error};
use sp_inherents::{Error, InherentData, InherentIdentifier};
/// The Aura inherent identifier.
pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"auraslot";
@@ -28,13 +27,13 @@ pub type InherentType = sp_consensus_slots::Slot;
/// Auxiliary trait to extract Aura inherent data.
pub trait AuraInherentData {
/// Get aura inherent data.
fn aura_inherent_data(&self) ->Result<Option<InherentType>, Error>;
fn aura_inherent_data(&self) -> Result<Option<InherentType>, Error>;
/// Replace aura inherent data.
fn aura_replace_inherent_data(&mut self, new: InherentType);
}
impl AuraInherentData for InherentData {
fn aura_inherent_data(&self) ->Result<Option<InherentType>, Error> {
fn aura_inherent_data(&self) -> Result<Option<InherentType>, Error> {
self.get_data(&INHERENT_IDENTIFIER)
}
@@ -54,9 +53,7 @@ pub struct InherentDataProvider {
impl InherentDataProvider {
/// Create a new instance with the given slot.
pub fn new(slot: InherentType) -> Self {
Self {
slot,
}
Self { slot }
}
/// Creates the inherent data provider by calculating the slot from the given
@@ -65,13 +62,10 @@ impl InherentDataProvider {
timestamp: sp_timestamp::Timestamp,
duration: std::time::Duration,
) -> Self {
let slot = InherentType::from(
(timestamp.as_duration().as_millis() / duration.as_millis()) as u64
);
let slot =
InherentType::from((timestamp.as_duration().as_millis() / duration.as_millis()) as u64);
Self {
slot,
}
Self { slot }
}
}
@@ -87,10 +81,7 @@ impl sp_std::ops::Deref for InherentDataProvider {
#[cfg(feature = "std")]
#[async_trait::async_trait]
impl sp_inherents::InherentDataProvider for InherentDataProvider {
fn provide_inherent_data(
&self,
inherent_data: &mut InherentData,
) ->Result<(), Error> {
fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> {
inherent_data.put_data(INHERENT_IDENTIFIER, &self.slot)
}