Skip to content

Commit

Permalink
Revert unnecessary change
Browse files Browse the repository at this point in the history
  • Loading branch information
cecton committed Nov 6, 2023
1 parent a80d1d4 commit ab1e138
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/yew/src/html/component/children.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,13 @@ where
T: Clone,
{
/// Create children
pub fn new(children: impl Into<Rc<Vec<T>>>) -> Self {
Self {
children: Some(children.into()),
pub fn new(children: Vec<T>) -> Self {
if children.is_empty() {
Self { children: None }
} else {
Self {
children: Some(Rc::new(children)),
}
}
}

Expand Down

0 comments on commit ab1e138

Please sign in to comment.