diff options
| author | 2022-03-29 22:55:06 +0200 | |
|---|---|---|
| committer | 2022-03-29 22:55:06 +0200 | |
| commit | cfc164d83deceb6ed02684722667fccadffe26c0 (patch) | |
| tree | ddef7ee828668cff58fd365abe53efe6eb791d6c /pure/src | |
| parent | 662c76488bc242457ae6a3da9748fbac23647b19 (diff) | |
| download | iced-cfc164d83deceb6ed02684722667fccadffe26c0.tar.gz iced-cfc164d83deceb6ed02684722667fccadffe26c0.tar.bz2 iced-cfc164d83deceb6ed02684722667fccadffe26c0.zip | |
Implement `Default` for `pure::State`
Impure Applications using pure widgets can now use a struct implementing `Default`
Diffstat (limited to 'pure/src')
| -rw-r--r-- | pure/src/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pure/src/lib.rs b/pure/src/lib.rs index 71d20a4d..c16b12b0 100644 --- a/pure/src/lib.rs +++ b/pure/src/lib.rs @@ -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 { |
