mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 22:47:56 +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:
@@ -23,13 +23,13 @@
|
||||
pub use frame_support_procedural_tools_derive::*;
|
||||
|
||||
use proc_macro_crate::{crate_name, FoundCrate};
|
||||
use syn::parse::Error;
|
||||
use quote::quote;
|
||||
use syn::parse::Error;
|
||||
|
||||
pub mod syn_ext;
|
||||
|
||||
// FIXME #1569, remove the following functions, which are copied from sp-api-macros
|
||||
use proc_macro2::{TokenStream, Span};
|
||||
use proc_macro2::{Span, TokenStream};
|
||||
use syn::Ident;
|
||||
|
||||
fn generate_hidden_includes_mod_name(unique_id: &str) -> Ident {
|
||||
@@ -39,7 +39,7 @@ fn generate_hidden_includes_mod_name(unique_id: &str) -> Ident {
|
||||
/// Generates the access to the `frame-support` crate.
|
||||
pub fn generate_crate_access(unique_id: &str, def_crate: &str) -> TokenStream {
|
||||
if std::env::var("CARGO_PKG_NAME").unwrap() == def_crate {
|
||||
quote::quote!( frame_support )
|
||||
quote::quote!(frame_support)
|
||||
} else {
|
||||
let mod_name = generate_hidden_includes_mod_name(unique_id);
|
||||
quote::quote!( self::#mod_name::hidden_include )
|
||||
@@ -55,12 +55,8 @@ pub fn generate_crate_access_2018(def_crate: &str) -> Result<syn::Ident, Error>
|
||||
let name = def_crate.to_string().replace("-", "_");
|
||||
Ok(syn::Ident::new(&name, Span::call_site()))
|
||||
},
|
||||
Ok(FoundCrate::Name(name)) => {
|
||||
Ok(Ident::new(&name, Span::call_site()))
|
||||
},
|
||||
Err(e) => {
|
||||
Err(Error::new(Span::call_site(), e))
|
||||
}
|
||||
Ok(FoundCrate::Name(name)) => Ok(Ident::new(&name, Span::call_site())),
|
||||
Err(e) => Err(Error::new(Span::call_site(), e)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +78,7 @@ pub fn generate_hidden_includes(unique_id: &str, def_crate: &str) -> TokenStream
|
||||
Err(e) => {
|
||||
let err = Error::new(Span::call_site(), e).to_compile_error();
|
||||
quote!( #err )
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user