Skip to content

Commit

Permalink
feat(virtual-dom): blanket impl of IntoNodes for Option
Browse files Browse the repository at this point in the history
  • Loading branch information
glennsl authored and MartinKavik committed Oct 2, 2021
1 parent 2050175 commit d028591
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/virtual_dom/node/into_nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl<Ms> IntoNodes<Ms> for Node<Ms> {
}
}

impl<Ms> IntoNodes<Ms> for Option<Node<Ms>> {
impl<Ms, T: IntoNodes<Ms>> IntoNodes<Ms> for Option<T> {
fn into_nodes(self) -> Vec<Node<Ms>> {
self.map(IntoNodes::into_nodes).unwrap_or_default()
}
Expand All @@ -25,9 +25,3 @@ impl<Ms> IntoNodes<Ms> for Vec<Node<Ms>> {
self
}
}

impl<Ms> IntoNodes<Ms> for Option<Vec<Node<Ms>>> {
fn into_nodes(self) -> Vec<Node<Ms>> {
self.unwrap_or_default()
}
}

0 comments on commit d028591

Please # to comment.