From 7168ceafe3438082900214c760bec777dcb9421f Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sat, 7 May 2022 16:04:50 +0200 Subject: [PATCH] small optimization to llvm codegen amount --- crates/eww/src/widgets/def_widget_macro.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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.