mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Fix #[internal]
fields needing IntoValue
impl (#3103)
This commit is contained in:
parent
4bf16d7acb
commit
a236e362db
@ -834,17 +834,21 @@ fn create_native_elem_impl(element: &Elem) -> TokenStream {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Creation of the fields dictionary for inherent fields.
|
// Creation of the fields dictionary for inherent fields.
|
||||||
let field_dict = element.inherent_fields().clone().map(|field| {
|
let field_dict = element
|
||||||
let name = &field.name;
|
.inherent_fields()
|
||||||
let field_ident = &field.ident;
|
.filter(|field| !field.internal)
|
||||||
let field_call = quote! { ::ecow::EcoString::from(#name).into() };
|
.clone()
|
||||||
quote! {
|
.map(|field| {
|
||||||
fields.insert(
|
let name = &field.name;
|
||||||
#field_call,
|
let field_ident = &field.ident;
|
||||||
#foundations::IntoValue::into_value(self.#field_ident.clone())
|
let field_call = quote! { ::ecow::EcoString::from(#name).into() };
|
||||||
);
|
quote! {
|
||||||
}
|
fields.insert(
|
||||||
});
|
#field_call,
|
||||||
|
#foundations::IntoValue::into_value(self.#field_ident.clone())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Creation of the fields dictionary for optional fields.
|
// Creation of the fields dictionary for optional fields.
|
||||||
let field_opt_dict = element
|
let field_opt_dict = element
|
||||||
|
Loading…
x
Reference in New Issue
Block a user