Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

fix(macros): box large constructor default expressions

ldm032777a338b33
diff --git a/moli-webapi-declare-derive/src/attrs.rs b/moli-webapi-declare-derive/src/attrs.rs
index 8f011e2a6..af1442dc1 100644
--- a/moli-webapi-declare-derive/src/attrs.rs
+++ b/moli-webapi-declare-derive/src/attrs.rs
@@ -33,7 +33,7 @@ pub(crate) enum ValueInitAttr {
#[derive(Clone)]
pub(crate) enum ConstructorDefaultAttr {
Default,
- Expr(Expr),
+ Expr(Box<Expr>),
}
#[derive(Clone, Copy, Default)]
@@ -502,7 +502,7 @@ pub(crate) fn parse_field_attrs(field: &Field) -> Result<FieldAttrs, Error> {
}
if meta.path.is_ident("constructor_default") {
let default = if meta.input.peek(Token![=]) {
- ConstructorDefaultAttr::Expr(meta.value()?.parse()?)
+ ConstructorDefaultAttr::Expr(Box::new(meta.value()?.parse()?))
} else {
ConstructorDefaultAttr::Default
};