From 89d50c0243fcb70442c78bbff207d0328b33e158 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 17:04:44 +0700 Subject: Reintroduce `Box` for `style_sheet` in `PaneGrid` --- style/src/pane_grid.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'style') diff --git a/style/src/pane_grid.rs b/style/src/pane_grid.rs index 032fcb6d..89cf39ea 100644 --- a/style/src/pane_grid.rs +++ b/style/src/pane_grid.rs @@ -35,8 +35,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