Skip to content

Commit

Permalink
Checkbox 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 fd064ff commit 15f5b93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions native/src/widget/checkbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ impl<Message, Renderer: self::Renderer + text::Renderer>
/// `Message`.
///
/// [`Checkbox`]: struct.Checkbox.html
pub fn new<F>(is_checked: bool, label: &str, f: F) -> Self
pub fn new<F>(is_checked: bool, label: impl Into<String>, f: F) -> Self
where
F: 'static + Fn(bool) -> Message,
{
Checkbox {
is_checked,
on_toggle: Box::new(f),
label: String::from(label),
label: label.into(),
width: Length::Shrink,
size: <Renderer as self::Renderer>::DEFAULT_SIZE,
spacing: Renderer::DEFAULT_SPACING,
Expand Down

0 comments on commit 15f5b93

Please sign in to comment.