codegen: Use quote::idents instead of &str for naming types

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2024-05-02 12:09:09 +00:00
parent 7c73b6d32c
commit 21bbdc4855
+3 -2
View File
@@ -9,7 +9,7 @@ use std::collections::HashSet;
use subxt_metadata::{CustomValueMetadata, Metadata};
use proc_macro2::TokenStream as TokenStream2;
use quote::quote;
use quote::{format_ident, quote};
/// Generate the custom values mod, if there are any custom values in the metadata. Else returns None.
pub fn generate_custom_values(
@@ -20,7 +20,8 @@ pub fn generate_custom_values(
let mut fn_names_taken = HashSet::new();
let custom = metadata.custom();
let custom_types = custom.iter().map(|custom| {
let name = custom.name();
let name = format_ident!("{}", custom.name());
let Ok(ty) = type_gen.resolve_type_path(custom.type_id()) else {
return quote! {};
};