Implement Default for pure::State
Impure Applications using pure widgets can now use a struct implementing `Default`
This commit is contained in:
parent
662c76488b
commit
cfc164d83d
1 changed files with 8 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue