From fcc282bd76c88f389d510411b0ae73e1a4eaf317 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 16:58:02 +0700 Subject: Reintroduce `Box` for `style_sheet` in `Checkbox` --- style/src/checkbox.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'style') 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 { fn default() -> Self { - &Default + Box::new(Default) + } +} + +impl<'a, T> From for Box +where + T: StyleSheet + 'a, +{ + fn from(style_sheet: T) -> Self { + Box::new(style_sheet) } } -- cgit