Checkbox label is now impl Into<String>
This commit is contained in:
parent
fd064ff990
commit
15f5b93a0d
@ -50,14 +50,14 @@ impl<Message, Renderer: self::Renderer + text::Renderer>
|
|||||||
/// `Message`.
|
/// `Message`.
|
||||||
///
|
///
|
||||||
/// [`Checkbox`]: struct.Checkbox.html
|
/// [`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
|
where
|
||||||
F: 'static + Fn(bool) -> Message,
|
F: 'static + Fn(bool) -> Message,
|
||||||
{
|
{
|
||||||
Checkbox {
|
Checkbox {
|
||||||
is_checked,
|
is_checked,
|
||||||
on_toggle: Box::new(f),
|
on_toggle: Box::new(f),
|
||||||
label: String::from(label),
|
label: label.into(),
|
||||||
width: Length::Shrink,
|
width: Length::Shrink,
|
||||||
size: <Renderer as self::Renderer>::DEFAULT_SIZE,
|
size: <Renderer as self::Renderer>::DEFAULT_SIZE,
|
||||||
spacing: Renderer::DEFAULT_SPACING,
|
spacing: Renderer::DEFAULT_SPACING,
|
||||||
|
Loading…
Reference in New Issue
Block a user