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,14 +16,14 @@
// limitations under the License.
use proc_macro2::{Span, TokenStream};
use quote::{ToTokens, format_ident, quote};
use quote::{format_ident, quote, ToTokens};
use syn::{Ident, Result};
const MAX_IDENTS: usize = 18;
pub fn impl_key_prefix_for_tuples(input: proc_macro::TokenStream) -> Result<TokenStream> {
if !input.is_empty() {
return Err(syn::Error::new(Span::call_site(), "No arguments expected"));
return Err(syn::Error::new(Span::call_site(), "No arguments expected"))
}
let mut all_trait_impls = TokenStream::new();
@@ -36,13 +36,17 @@ pub fn impl_key_prefix_for_tuples(input: proc_macro::TokenStream) -> Result<Toke
for prefix_count in 1..i {
let (prefixes, suffixes) = current_tuple.split_at(prefix_count);
let hashers = current_tuple.iter().map(|ident| format_ident!("Hasher{}", ident)).collect::<Vec<_>>();
let kargs = prefixes.iter().map(|ident| format_ident!("KArg{}", ident)).collect::<Vec<_>>();
let hashers = current_tuple
.iter()
.map(|ident| format_ident!("Hasher{}", ident))
.collect::<Vec<_>>();
let kargs =
prefixes.iter().map(|ident| format_ident!("KArg{}", ident)).collect::<Vec<_>>();
let partial_keygen = generate_keygen(prefixes);
let suffix_keygen = generate_keygen(suffixes);
let suffix_tuple = generate_tuple(suffixes);
let trait_impls = quote!{
let trait_impls = quote! {
impl<
#(#current_tuple: FullCodec,)*
#(#hashers: StorageHasher,)*