mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-22 12:37:59 +00:00
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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user