summaryrefslogtreecommitdiffstats
path: root/style
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 16:58:02 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 16:58:02 +0700
commitfcc282bd76c88f389d510411b0ae73e1a4eaf317 (patch)
tree407ad2d80b9a87064787bd3f4b5ee5f3188b4cda /style
parentd36ce33a95c277ee8fe45555df17daf21ef02ef8 (diff)
downloadiced-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.rs13
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)
}
}