From ee2d40d77f6ac3a7f6e72163d484f2801e4922fe Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 26 Aug 2019 04:07:52 +0200 Subject: Make `Color` optional instead of `Default` --- src/widget/radio.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/widget/radio.rs') diff --git a/src/widget/radio.rs b/src/widget/radio.rs index 75ddd35d..2f34b5e4 100644 --- a/src/widget/radio.rs +++ b/src/widget/radio.rs @@ -54,7 +54,7 @@ pub struct Radio { is_selected: bool, on_click: Message, label: String, - label_color: Color, + label_color: Option, } impl std::fmt::Debug for Radio @@ -72,10 +72,7 @@ where } } -impl Radio -where - Color: Default, -{ +impl Radio { /// Creates a new [`Radio`] button. /// /// It expects: @@ -95,7 +92,7 @@ where is_selected: Some(value) == selected, on_click: f(value), label: String::from(label), - label_color: Color::default(), + label_color: None, } } @@ -104,7 +101,7 @@ where /// [`Color`]: ../../../../graphics/struct.Color.html /// [`Radio`]: struct.Radio.html pub fn label_color(mut self, color: Color) -> Self { - self.label_color = color; + self.label_color = Some(color); self } } -- cgit