summaryrefslogtreecommitdiffstats
path: root/style
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:39:24 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:39:24 +0700
commiteed19dcf81334d0849744f1918ba880d5a7acc1c (patch)
tree56be76de94193b083692a5910d5a4d93e024e5b2 /style
parent48490c3d878da1e2760c7701e80586c3653d5bd8 (diff)
downloadiced-eed19dcf81334d0849744f1918ba880d5a7acc1c.tar.gz
iced-eed19dcf81334d0849744f1918ba880d5a7acc1c.tar.bz2
iced-eed19dcf81334d0849744f1918ba880d5a7acc1c.zip
Reintroduce `Box` for `style_sheet` in `Scrollable`
Diffstat (limited to 'style')
-rw-r--r--style/src/scrollable.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/style/src/scrollable.rs b/style/src/scrollable.rs
index 741d9d39..9de72add 100644
--- a/style/src/scrollable.rs
+++ b/style/src/scrollable.rs
@@ -60,8 +60,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)
}
}