Skip to content

Commit

Permalink
xilem_web: Support arrays (`impl IntoClasses for [impl IntoClasses; N…
Browse files Browse the repository at this point in the history
…]`) as classes (#198)

Support arrays (`impl IntoClasses for [impl IntoClasses; N]`) as classes
  • Loading branch information
Philipp-M authored Apr 16, 2024
1 parent 041ea0d commit 9a118da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/xilem_web/src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ where
}
}

impl<T: IntoClasses, const N: usize> IntoClasses for [T; N] {
fn into_classes(self, classes: &mut Vec<Cow<'static, str>>) {
for itm in self {
itm.into_classes(classes);
}
}
}

macro_rules! impl_tuple_intoclasses {
($($name:ident : $type:ident),* $(,)?) => {
impl<$($type),*> IntoClasses for ($($type,)*)
Expand Down

0 comments on commit 9a118da

Please sign in to comment.