diff options
author | 2021-10-31 17:02:59 +0700 | |
---|---|---|
committer | 2021-10-31 17:02:59 +0700 | |
commit | 40a5de581144886571504b762719f057dbb2e871 (patch) | |
tree | d931882c7840367c6ddd766e7d9e8cec62d0130f /style | |
parent | fcc282bd76c88f389d510411b0ae73e1a4eaf317 (diff) | |
download | iced-40a5de581144886571504b762719f057dbb2e871.tar.gz iced-40a5de581144886571504b762719f057dbb2e871.tar.bz2 iced-40a5de581144886571504b762719f057dbb2e871.zip |
Reintroduce `Box` for `style_sheet` in `Container`
Diffstat (limited to 'style')
-rw-r--r-- | style/src/container.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/style/src/container.rs b/style/src/container.rs index 6b0a129b..a5dc700e 100644 --- a/style/src/container.rs +++ b/style/src/container.rs @@ -43,8 +43,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) } } |