Skip to content

Commit f7f669c

Browse files
committed
feat: use into
1 parent cf78796 commit f7f669c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

html-node-core/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,14 @@ impl Node {
8585
}
8686
}
8787

88-
impl<I> From<I> for Node
88+
impl<I, N> From<I> for Node
8989
where
90-
I: IntoIterator<Item = Self>,
90+
I: IntoIterator<Item = N>,
91+
N: Into<Self>,
9192
{
9293
fn from(iter: I) -> Self {
9394
Self::Fragment(Fragment {
94-
children: iter.into_iter().collect(),
95+
children: iter.into_iter().map(Into::into).collect(),
9596
})
9697
}
9798
}

0 commit comments

Comments
 (0)