summaryrefslogtreecommitdiffstats
path: root/style
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:45:57 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-31 17:45:57 +0700
commit0d3c9ef7bd3d0a0abecdf8e8b5391e32773ca20e (patch)
tree77b8c4282e3baec2a7ac6c18eff923d296d2a11a /style
parent0c76e0307ff7d4450c354812f8a25047f24948b4 (diff)
downloadiced-0d3c9ef7bd3d0a0abecdf8e8b5391e32773ca20e.tar.gz
iced-0d3c9ef7bd3d0a0abecdf8e8b5391e32773ca20e.tar.bz2
iced-0d3c9ef7bd3d0a0abecdf8e8b5391e32773ca20e.zip
Reintroduce `Box` for `style_sheet` in `TextInput`
Diffstat (limited to 'style')
-rw-r--r--style/src/text_input.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/style/src/text_input.rs b/style/src/text_input.rs
index 13b64cd5..4260af84 100644
--- a/style/src/text_input.rs
+++ b/style/src/text_input.rs
@@ -73,8 +73,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)
}
}