Update scale-info to 2.5.0 (#896)

* Upodate scale-info to 2.5.0

* A couple more clippy fixes

* more deprecation things that appeared
This commit is contained in:
James Wilson
2023-04-03 12:52:25 +01:00
committed by GitHub
parent 34f0521fd2
commit c08eb6c8f1
25 changed files with 150 additions and 155 deletions
+7 -7
View File
@@ -260,13 +260,13 @@ impl RuntimeGenerator {
// Get the path to the `Runtime` struct. We assume that the same path contains
// RuntimeCall and RuntimeEvent.
let runtime_type_id = self.metadata.ty.id();
let runtime_type_id = self.metadata.ty.id;
let runtime_path_segments = self
.metadata
.types
.resolve(runtime_type_id)
.ok_or(CodegenError::TypeNotFound(runtime_type_id))?
.path()
.path
.namespace()
.iter()
.map(|part| syn::PathSegment::from(format_ident!("{}", part)));
@@ -489,24 +489,24 @@ where
{
let ty = type_gen.resolve_type(type_id);
let scale_info::TypeDef::Variant(variant) = ty.type_def() else {
let scale_info::TypeDef::Variant(variant) = &ty.type_def else {
return Err(CodegenError::InvalidType(error_message_type_name.into()))
};
variant
.variants()
.variants
.iter()
.map(|var| {
let struct_name = variant_to_struct_name(var.name());
let struct_name = variant_to_struct_name(&var.name);
let fields = CompositeDefFields::from_scale_info_fields(
struct_name.as_ref(),
var.fields(),
&var.fields,
&[],
type_gen,
)?;
let docs = should_gen_docs.then_some(var.docs()).unwrap_or_default();
let docs = should_gen_docs.then_some(&*var.docs).unwrap_or_default();
let struct_def = CompositeDef::struct_def(
&ty,
struct_name.as_ref(),