From 1a9bfd9e737c4203c9ec607465c106da08ad5020 Mon Sep 17 00:00:00 2001 From: Dmitry Kashitsyn Date: Sun, 5 Apr 2020 10:29:25 +0700 Subject: Radiobutton label is now `impl Into` --- native/src/widget/radio.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'native') diff --git a/native/src/widget/radio.rs b/native/src/widget/radio.rs index 8fb3d0cc..bc23c116 100644 --- a/native/src/widget/radio.rs +++ b/native/src/widget/radio.rs @@ -53,7 +53,12 @@ impl Radio { /// receives the value of the radio and must produce a `Message`. /// /// [`Radio`]: struct.Radio.html - pub fn new(value: V, label: &str, selected: Option, f: F) -> Self + pub fn new( + value: V, + label: impl Into, + selected: Option, + f: F, + ) -> Self where V: Eq + Copy, F: 'static + Fn(V) -> Message, @@ -61,7 +66,7 @@ impl Radio { Radio { is_selected: Some(value) == selected, on_click: f(value), - label: String::from(label), + label: label.into(), style: Renderer::Style::default(), } } -- cgit