diff options
Diffstat (limited to 'web/src/widget/radio.rs')
-rw-r--r-- | web/src/widget/radio.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/web/src/widget/radio.rs b/web/src/widget/radio.rs index e00e26db..520b24cd 100644 --- a/web/src/widget/radio.rs +++ b/web/src/widget/radio.rs @@ -49,7 +49,12 @@ impl<Message> Radio<Message> { /// receives the value of the radio and must produce a `Message`. /// /// [`Radio`]: struct.Radio.html - pub fn new<F, V>(value: V, label: &str, selected: Option<V>, f: F) -> Self + pub fn new<F, V>( + value: V, + label: impl Into<String>, + selected: Option<V>, + f: F, + ) -> Self where V: Eq + Copy, F: 'static + Fn(V) -> Message, @@ -57,7 +62,7 @@ impl<Message> Radio<Message> { Radio { is_selected: Some(value) == selected, on_click: f(value), - label: String::from(label), + label: label.into(), style: Default::default(), } } |