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
+15 -11
View File
@@ -19,11 +19,14 @@
//! or client/alloc to be used with any code that depends on the runtime.
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(feature = "std",
doc = "Substrate runtime standard library as compiled when linked with Rust's standard library.")]
#![cfg_attr(not(feature = "std"),
doc = "Substrate's runtime standard library as compiled without Rust's standard library.")]
#![cfg_attr(
feature = "std",
doc = "Substrate runtime standard library as compiled when linked with Rust's standard library."
)]
#![cfg_attr(
not(feature = "std"),
doc = "Substrate's runtime standard library as compiled without Rust's standard library."
)]
#[macro_export]
macro_rules! map {
@@ -55,7 +58,7 @@ macro_rules! if_std {
#[cfg(not(feature = "std"))]
#[macro_export]
macro_rules! if_std {
( $( $code:tt )* ) => {}
( $( $code:tt )* ) => {};
}
#[cfg(feature = "std")]
@@ -64,7 +67,6 @@ include!("../with_std.rs");
#[cfg(not(feature = "std"))]
include!("../without_std.rs");
/// A target for `core::write!` macro - constructs a string in memory.
#[derive(Default)]
pub struct Writer(vec::Vec<u8>);
@@ -92,10 +94,12 @@ impl Writer {
///
/// This should include only things which are in the normal std prelude.
pub mod prelude {
pub use crate::vec::Vec;
pub use crate::boxed::Box;
pub use crate::cmp::{Eq, PartialEq, Reverse};
pub use crate::clone::Clone;
pub use crate::{
boxed::Box,
clone::Clone,
cmp::{Eq, PartialEq, Reverse},
vec::Vec,
};
// Re-export `vec!` macro here, but not in `std` mode, since
// std's prelude already brings `vec!` into the scope.