diff --git a/crates/eww/src/widgets/def_widget_macro.rs b/crates/eww/src/widgets/def_widget_macro.rs index 14beee3..8fa8bc3 100644 --- a/crates/eww/src/widgets/def_widget_macro.rs +++ b/crates/eww/src/widgets/def_widget_macro.rs @@ -9,7 +9,10 @@ macro_rules! def_widget { }) => { $({ $( - $args.unhandled_attrs.retain(|a| &a.0 != &::std::stringify!($attr_name).replace('_', "-")); + // explicitly box the function to not cause tons of monomorphization related duplications of Vec::retain + let retain_fn: Box bool> = + Box::new(|a| &a.0 != &::std::stringify!($attr_name).replace('_', "-")); + $args.unhandled_attrs.retain(retain_fn); )* // Map of all attributes to their provided expressions.