From d39ad717ed0ab85acbe935d7ab883166b36e7bc7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 20 Oct 2021 19:06:53 +0700 Subject: Wire up styling to `Radio` in `iced_native` --- style/src/radio.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'style/src/radio.rs') diff --git a/style/src/radio.rs b/style/src/radio.rs index c41b70c0..add12754 100644 --- a/style/src/radio.rs +++ b/style/src/radio.rs @@ -37,17 +37,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 bd7b086ec1f9d428945f05fb12bda157f9e77dfd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 31 Oct 2021 17:14:10 +0700 Subject: Reintroduce `Box` for `style_sheet` in `Radio` --- style/src/radio.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'style/src/radio.rs') diff --git a/style/src/radio.rs b/style/src/radio.rs index add12754..724ae807 100644 --- a/style/src/radio.rs +++ b/style/src/radio.rs @@ -37,8 +37,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/radio.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'style/src/radio.rs') diff --git a/style/src/radio.rs b/style/src/radio.rs index 724ae807..6fb1cb6c 100644 --- a/style/src/radio.rs +++ b/style/src/radio.rs @@ -37,7 +37,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