Skip to content

Commit

Permalink
[feature] #2626, #2588: Implement Combine derive, split config ma…
Browse files Browse the repository at this point in the history
…cros

Signed-off-by: Ilia Churin <[email protected]>
  • Loading branch information
ilchu committed Sep 15, 2022
1 parent 194a3b2 commit 5bc50d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/base/derive/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
7 changes: 7 additions & 0 deletions config/base/derive/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ impl ToTokens for StructField {
pub struct StructWithFields {
pub attrs: Vec<Attribute>,
pub env_prefix: String,
// pub parent_ty: Type,
pub vis: syn::Visibility,
_struct_token: Token![struct],
pub ident: Ident,
Expand All @@ -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::<BuilderParent>::parse)
// .find_map(Result::ok)
// .map(|builder| builder.parent)
// .expect("???");
Ok(Self {
attrs,
vis: input.parse()?,
Expand Down

0 comments on commit 5bc50d0

Please sign in to comment.