Skip to content

Commit

Permalink
Radiobutton label is now impl Into<String>
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7CFE committed Apr 5, 2020
1 parent f61740b commit b1f484b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions native/src/widget/radio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ impl<Message, Renderer: self::Renderer> Radio<Message, Renderer> {
/// 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,
{
Radio {
is_selected: Some(value) == selected,
on_click: f(value),
label: String::from(label),
label: label.into(),
style: Renderer::Style::default(),
}
}
Expand Down

0 comments on commit b1f484b

Please sign in to comment.