From 7c08c6bd138207b862933ee479752a4f1d18c4f2 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 21 Oct 2021 18:50:27 +0700 Subject: Remove `Renderer` trait for `Checkbox` --- style/src/checkbox.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'style/src/checkbox.rs') diff --git a/style/src/checkbox.rs b/style/src/checkbox.rs index 566136bb..4c88faaa 100644 --- a/style/src/checkbox.rs +++ b/style/src/checkbox.rs @@ -39,17 +39,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 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/src/checkbox.rs') 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 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/checkbox.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'style/src/checkbox.rs') diff --git a/style/src/checkbox.rs b/style/src/checkbox.rs index 09f997fb..f8bc6241 100644 --- a/style/src/checkbox.rs +++ b/style/src/checkbox.rs @@ -39,7 +39,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