mirror of
https://github.com/Zenithsiz/dynatos.git
synced 2026-02-04 02:18:40 +00:00
NodeWithChildren now supports &[C] and Vec<C>.
This commit is contained in:
parent
e4f0efbbf5
commit
b958d581c2
@ -86,7 +86,7 @@ impl Children for () {
|
||||
}
|
||||
}
|
||||
|
||||
impl<C, const N: usize> Children for [C; N]
|
||||
impl<C> Children for &'_ [C]
|
||||
where
|
||||
C: AsRef<web_sys::Node>,
|
||||
{
|
||||
@ -105,6 +105,24 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<C, const N: usize> Children for [C; N]
|
||||
where
|
||||
C: AsRef<web_sys::Node>,
|
||||
{
|
||||
fn append_all(self, node: &web_sys::Node) -> Result<(), JsValue> {
|
||||
self.as_slice().append_all(node)
|
||||
}
|
||||
}
|
||||
|
||||
impl<C> Children for Vec<C>
|
||||
where
|
||||
C: AsRef<web_sys::Node>,
|
||||
{
|
||||
fn append_all(self, node: &web_sys::Node) -> Result<(), JsValue> {
|
||||
self.as_slice().append_all(node)
|
||||
}
|
||||
}
|
||||
|
||||
/// Implements `Children` on tuples
|
||||
macro impl_children_tuple( $( $( $C:ident($idx:tt) ),*; )* ) {
|
||||
$(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user