Remove unneeded Config bounds and BlockNumber associated type (#804)

* remove unneeded Config bounds and BlockNumber associated type

* clippy and fmt
This commit is contained in:
James Wilson
2023-01-27 14:01:47 +00:00
committed by GitHub
parent 171bd62bb2
commit ce0a82e322
27 changed files with 72 additions and 112 deletions
+2 -2
View File
@@ -370,8 +370,8 @@ impl RuntimeGenerator {
}
/// Return a vector of tuples of variant names and corresponding struct definitions.
pub fn generate_structs_from_variants<'a, F>(
type_gen: &'a TypeGenerator,
pub fn generate_structs_from_variants<F>(
type_gen: &TypeGenerator,
type_id: u32,
variant_to_struct_name: F,
error_message_type_name: &str,
+2 -5
View File
@@ -131,7 +131,7 @@ impl<'a> TypeGenerator<'a> {
pub fn resolve_type(&self, id: u32) -> Type<PortableForm> {
self.type_registry
.resolve(id)
.unwrap_or_else(|| panic!("No type with id {} found", id))
.unwrap_or_else(|| panic!("No type with id {id} found"))
.clone()
}
@@ -403,10 +403,7 @@ impl ToTokens for CratePath {
impl From<&str> for CratePath {
fn from(crate_path: &str) -> Self {
Self(syn::Path::from_string(crate_path).unwrap_or_else(|err| {
panic!(
"failed converting {:?} to `syn::Path`: {:?}",
crate_path, err
);
panic!("failed converting {crate_path:?} to `syn::Path`: {err:?}");
}))
}
}
+1 -1
View File
@@ -127,7 +127,7 @@ impl TypePathType {
"BTreeSet" => parse_quote!(::std::collections::BTreeSet),
"Range" => parse_quote!(::core::ops::Range),
"RangeInclusive" => parse_quote!(::core::ops::RangeInclusive),
ident => panic!("Unknown prelude type '{}'", ident),
ident => panic!("Unknown prelude type '{ident}'"),
}
}
_ => {