From 9a118da68792bc4c05702cd7b2b4f7f5538a5450 Mon Sep 17 00:00:00 2001 From: Philipp Mildenberger Date: Tue, 16 Apr 2024 17:00:54 +0200 Subject: [PATCH] xilem_web: Support arrays (`impl IntoClasses for [impl IntoClasses; N]`) as classes (#198) Support arrays (`impl IntoClasses for [impl IntoClasses; N]`) as classes --- crates/xilem_web/src/class.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/xilem_web/src/class.rs b/crates/xilem_web/src/class.rs index da2f58769..66b83ca23 100644 --- a/crates/xilem_web/src/class.rs +++ b/crates/xilem_web/src/class.rs @@ -52,6 +52,14 @@ where } } +impl IntoClasses for [T; N] { + fn into_classes(self, classes: &mut Vec>) { + for itm in self { + itm.into_classes(classes); + } + } +} + macro_rules! impl_tuple_intoclasses { ($($name:ident : $type:ident),* $(,)?) => { impl<$($type),*> IntoClasses for ($($type,)*)