diff --git a/config/base/derive/src/proxy.rs b/config/base/derive/src/proxy.rs index 37d0019beeb..e7b915bb118 100644 --- a/config/base/derive/src/proxy.rs +++ b/config/base/derive/src/proxy.rs @@ -7,7 +7,7 @@ use crate::utils; pub fn impl_proxy(ast: StructWithFields) -> TokenStream { // somewhat awkward conversion, could it be better? - let parent_name = ast.ident.clone(); + let parent_name = &ast.ident; let parent_ty: Type = parse_quote! { #parent_name }; let proxy_struct = gen_proxy_struct(ast); let loadenv_derive = quote! { ::iroha_config_base::derive::LoadFromEnv }; diff --git a/config/base/derive/src/utils.rs b/config/base/derive/src/utils.rs index af2e8f718ae..52b490e5ba2 100644 --- a/config/base/derive/src/utils.rs +++ b/config/base/derive/src/utils.rs @@ -214,6 +214,7 @@ impl ToTokens for StructField { pub struct StructWithFields { pub attrs: Vec, pub env_prefix: String, + // pub parent_ty: Type, pub vis: syn::Visibility, _struct_token: Token![struct], pub ident: Ident, @@ -231,6 +232,12 @@ impl Parse for StructWithFields { .find_map(Result::ok) .map(|pref| pref.prefix.value()) .unwrap_or_default(); + // let parent_ty = attrs + // .iter() + // .map(Builder::::parse) + // .find_map(Result::ok) + // .map(|builder| builder.parent) + // .expect("???"); Ok(Self { attrs, vis: input.parse()?,