summaryrefslogtreecommitdiffstats
path: root/style
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:14:10 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:14:10 +0700
commitbd7b086ec1f9d428945f05fb12bda157f9e77dfd (patch)
tree4be12be5f1c96d54233633ba14bd6e0360a7fa7f /style
parentd758006ee91aa0fdb70eaa67abbfad36be02c7be (diff)
downloadiced-bd7b086ec1f9d428945f05fb12bda157f9e77dfd.tar.gz
iced-bd7b086ec1f9d428945f05fb12bda157f9e77dfd.tar.bz2
iced-bd7b086ec1f9d428945f05fb12bda157f9e77dfd.zip
Reintroduce `Box` for `style_sheet` in `Radio`
Diffstat (limited to 'style')
-rw-r--r--style/src/radio.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/style/src/radio.rs b/style/src/radio.rs
index add12754..724ae807 100644
--- a/style/src/radio.rs
+++ b/style/src/radio.rs
@@ -37,8 +37,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)
}
}