From cb7adfbea82ca5cb9a78040f40f124131e4f7481 Mon Sep 17 00:00:00 2001 From: junzhuo Date: Tue, 31 Dec 2024 08:13:33 +0800 Subject: [PATCH] remove extra_ctx in Builder --- macros/src/group.rs | 8 ++++---- src/timing/items.rs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/macros/src/group.rs b/macros/src/group.rs index 797ad9b..8a2d838 100644 --- a/macros/src/group.rs +++ b/macros/src/group.rs @@ -443,7 +443,7 @@ pub(crate) fn inner(ast: &DeriveInput) -> syn::Result attributes_name, comments_name, extra_ctx_name, - extra_ctx_type, + _extra_ctx_type, ) = parse_fields_type(fields)?; let this_str = "__this__"; let mut comment_fns = quote! { @@ -458,16 +458,16 @@ pub(crate) fn inner(ast: &DeriveInput) -> syn::Result }; let mut builder_fields = quote! { pub(crate) #attributes_name: crate::ast::Attributes, - pub(crate) #extra_ctx_name: #extra_ctx_type, + ____p: core::marker::PhantomData, }; let mut builder_inits = quote! { #attributes_name: Default::default(), - #extra_ctx_name: Default::default(), + ____p: core::marker::PhantomData, }; let mut build_arms = quote! { #comments_name: Default::default(), #attributes_name: builder.#attributes_name, - #extra_ctx_name: builder.#extra_ctx_name, + #extra_ctx_name: Default::default(), }; for name_field in &name_vec { let i = name_field.ident.clone().unwrap(); diff --git a/src/timing/items.rs b/src/timing/items.rs index 88e8a30..7aa0f3b 100644 --- a/src/timing/items.rs +++ b/src/timing/items.rs @@ -452,7 +452,7 @@ impl ParsingBuilder for Option> { size2: _value.values.size2, values: _value.values.inner, lvf_values, - extra_ctx: _value.extra_ctx, + extra_ctx: Default::default(), }) } (Some(_value), None, None, None) => Some(TimingTableLookUp { @@ -464,7 +464,7 @@ impl ParsingBuilder for Option> { size2: _value.values.size2, values: _value.values.inner, lvf_values: Vec::new(), - extra_ctx: _value.extra_ctx, + extra_ctx: Default::default(), }), _ => None, }