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
+21 -21
View File
@@ -20,36 +20,43 @@
#![cfg_attr(not(feature = "std"), no_std)]
mod benchmarking;
mod mock;
mod tests;
mod benchmarking;
pub mod weights;
use sp_std::prelude::*;
use codec::Codec;
use sp_runtime::MultiAddress;
use sp_runtime::traits::{
StaticLookup, LookupError, Zero, Saturating, AtLeast32Bit
use frame_support::traits::{BalanceStatus::Reserved, Currency, ReservableCurrency};
use sp_runtime::{
traits::{AtLeast32Bit, LookupError, Saturating, StaticLookup, Zero},
MultiAddress,
};
use frame_support::traits::{Currency, ReservableCurrency, BalanceStatus::Reserved};
use sp_std::prelude::*;
pub use weights::WeightInfo;
type BalanceOf<T> = <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
type BalanceOf<T> =
<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
pub use pallet::*;
#[frame_support::pallet]
pub mod pallet {
use super::*;
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
use super::*;
/// The module's config trait.
#[pallet::config]
pub trait Config: frame_system::Config {
/// Type used for storing an account's index; implies the maximum number of accounts the system
/// can hold.
type AccountIndex: Parameter + Member + MaybeSerializeDeserialize + Codec + Default + AtLeast32Bit + Copy;
type AccountIndex: Parameter
+ Member
+ MaybeSerializeDeserialize
+ Codec
+ Default
+ AtLeast32Bit
+ Copy;
/// The currency trait.
type Currency: ReservableCurrency<Self::AccountId>;
@@ -263,7 +270,7 @@ pub mod pallet {
}
/// Old name generated by `decl_event`.
#[deprecated(note="use `Event` instead")]
#[deprecated(note = "use `Event` instead")]
pub type RawEvent<T> = Event<T>;
#[pallet::error]
@@ -282,11 +289,8 @@ pub mod pallet {
/// The lookup from index to account.
#[pallet::storage]
pub type Accounts<T: Config> = StorageMap<
_, Blake2_128Concat,
T::AccountIndex,
(T::AccountId, BalanceOf<T>, bool)
>;
pub type Accounts<T: Config> =
StorageMap<_, Blake2_128Concat, T::AccountIndex, (T::AccountId, BalanceOf<T>, bool)>;
#[pallet::genesis_config]
pub struct GenesisConfig<T: Config> {
@@ -296,9 +300,7 @@ pub mod pallet {
#[cfg(feature = "std")]
impl<T: Config> Default for GenesisConfig<T> {
fn default() -> Self {
Self {
indices: Default::default(),
}
Self { indices: Default::default() }
}
}
@@ -321,9 +323,7 @@ impl<T: Config> Pallet<T> {
}
/// Lookup an address to get an Id, if there's one there.
pub fn lookup_address(
a: MultiAddress<T::AccountId, T::AccountIndex>
) -> Option<T::AccountId> {
pub fn lookup_address(a: MultiAddress<T::AccountId, T::AccountIndex>) -> Option<T::AccountId> {
match a {
MultiAddress::Id(i) => Some(i),
MultiAddress::Index(i) => Self::lookup_index(i),