From d61cb58d92b6fcd520f665deb093f3747ffd5e5c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 18 Oct 2021 15:36:32 +0700 Subject: Wire up `container` styling to `iced_native` --- style/src/container.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'style/src/container.rs') diff --git a/style/src/container.rs b/style/src/container.rs index 1ce6a7ca..6b0a129b 100644 --- a/style/src/container.rs +++ b/style/src/container.rs @@ -43,17 +43,8 @@ impl StyleSheet for Default { } } -impl std::default::Default for Box { +impl std::default::Default for &'static dyn StyleSheet { fn default() -> Self { - Box::new(Default) - } -} - -impl From for Box -where - T: 'static + StyleSheet, -{ - fn from(style: T) -> Self { - Box::new(style) + &Default } } -- cgit From 40a5de581144886571504b762719f057dbb2e871 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 17:02:59 +0700 Subject: Reintroduce `Box` for `style_sheet` in `Container` --- style/src/container.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'style/src/container.rs') 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 { 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 From 157a40a56882ec1959034fa499b383e7f633aaf8 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 2 Nov 2021 16:02:05 +0700 Subject: Introduce generic lifetime to `Default` implementation for style sheets --- style/src/container.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'style/src/container.rs') diff --git a/style/src/container.rs b/style/src/container.rs index a5dc700e..2f411611 100644 --- a/style/src/container.rs +++ b/style/src/container.rs @@ -43,7 +43,7 @@ impl StyleSheet for Default { } } -impl std::default::Default for Box { +impl<'a> std::default::Default for Box { fn default() -> Self { Box::new(Default) } -- cgit