Skip to content

Commit

Permalink
Implement Default for VNode (yewstack#672)
Browse files Browse the repository at this point in the history
* implement Default for VNode

* cargo fmt
  • Loading branch information
hgzimmerman authored and llebout committed Jan 20, 2020
1 parent 280eb2a commit d2f5c0a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/virtual_dom/vnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ impl<COMP: Component> VDiff for VNode<COMP> {
}
}

impl<COMP: Component> Default for VNode<COMP> {
fn default() -> Self {
VNode::VList(VList::new())
}
}

impl<COMP: Component> From<VText<COMP>> for VNode<COMP> {
fn from(vtext: VText<COMP>) -> Self {
VNode::VText(vtext)
Expand Down

0 comments on commit d2f5c0a

Please sign in to comment.