Implement Default for pure::State

Impure Applications using pure widgets can now use a struct implementing `Default`
This commit is contained in:
0x192 2022-03-29 22:55:06 +02:00
parent 662c76488b
commit cfc164d83d
No known key found for this signature in database
GPG key ID: 34D27465928A0A1D

View file

@ -41,6 +41,14 @@ pub struct State {
state_tree: widget::Tree,
}
impl Default for State {
fn default() -> Self {
Self {
state_tree: widget::Tree::empty(),
}
}
}
impl State {
pub fn new() -> Self {
Self {