diff options
author | 2021-10-31 16:58:02 +0700 | |
---|---|---|
committer | 2021-10-31 16:58:02 +0700 | |
commit | fcc282bd76c88f389d510411b0ae73e1a4eaf317 (patch) | |
tree | 407ad2d80b9a87064787bd3f4b5ee5f3188b4cda /style | |
parent | d36ce33a95c277ee8fe45555df17daf21ef02ef8 (diff) | |
download | iced-fcc282bd76c88f389d510411b0ae73e1a4eaf317.tar.gz iced-fcc282bd76c88f389d510411b0ae73e1a4eaf317.tar.bz2 iced-fcc282bd76c88f389d510411b0ae73e1a4eaf317.zip |
Reintroduce `Box` for `style_sheet` in `Checkbox`
Diffstat (limited to 'style')
-rw-r--r-- | style/src/checkbox.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/style/src/checkbox.rs b/style/src/checkbox.rs index 4c88faaa..09f997fb 100644 --- a/style/src/checkbox.rs +++ b/style/src/checkbox.rs @@ -39,8 +39,17 @@ impl StyleSheet for Default { } } -impl std::default::Default for &'static dyn StyleSheet { +impl std::default::Default for Box<dyn StyleSheet> { fn default() -> Self { - &Default + Box::new(Default) + } +} + +impl<'a, T> From<T> for Box<dyn StyleSheet + 'a> +where + T: StyleSheet + 'a, +{ + fn from(style_sheet: T) -> Self { + Box::new(style_sheet) } } |