From 15f5b93a0d4b7b7fead8d1864c77e6df50b9a231 Mon Sep 17 00:00:00 2001 From: Dmitry Kashitsyn Date: Sat, 4 Apr 2020 13:21:45 +0700 Subject: [PATCH] Checkbox label is now `impl Into` --- native/src/widget/checkbox.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/src/widget/checkbox.rs b/native/src/widget/checkbox.rs index 7f915456..ccf13848 100644 --- a/native/src/widget/checkbox.rs +++ b/native/src/widget/checkbox.rs @@ -50,14 +50,14 @@ impl /// `Message`. /// /// [`Checkbox`]: struct.Checkbox.html - pub fn new(is_checked: bool, label: &str, f: F) -> Self + pub fn new(is_checked: bool, label: impl Into, 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: ::DEFAULT_SIZE, spacing: Renderer::DEFAULT_SPACING,