Skip to content

Commit

Permalink
remove extra_ctx in Builder
Browse files Browse the repository at this point in the history
  • Loading branch information
zao111222333 committed Dec 31, 2024
1 parent be9c977 commit cb7adfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions macros/src/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ pub(crate) fn inner(ast: &DeriveInput) -> syn::Result<proc_macro2::TokenStream>
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! {
Expand All @@ -458,16 +458,16 @@ pub(crate) fn inner(ast: &DeriveInput) -> syn::Result<proc_macro2::TokenStream>
};
let mut builder_fields = quote! {
pub(crate) #attributes_name: crate::ast::Attributes,
pub(crate) #extra_ctx_name: #extra_ctx_type,
____p: core::marker::PhantomData<C>,
};
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();
Expand Down
4 changes: 2 additions & 2 deletions src/timing/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ impl<C: Ctx> ParsingBuilder for Option<TimingTableLookUp<C>> {
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 {
Expand All @@ -464,7 +464,7 @@ impl<C: Ctx> ParsingBuilder for Option<TimingTableLookUp<C>> {
size2: _value.values.size2,
values: _value.values.inner,
lvf_values: Vec::new(),
extra_ctx: _value.extra_ctx,
extra_ctx: Default::default(),
}),
_ => None,
}
Expand Down

0 comments on commit cb7adfb

Please sign in to comment.