summaryrefslogtreecommitdiffstats
path: root/native/src/widget/checkbox.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-04-06 20:31:39 +0200
committerLibravatar GitHub <noreply@github.com>2020-04-06 20:31:39 +0200
commit0f60253661bde4e0a21701c3d004743c3309aff1 (patch)
tree383def949c3fd68bad20ee4d1ab103fa24af2e35 /native/src/widget/checkbox.rs
parentad0a6c4c10afe6dceed52b953cd90aa04e91098a (diff)
parent3c47e3e2295e2dd6ca60e50111b9b89a4bb025fe (diff)
downloadiced-0f60253661bde4e0a21701c3d004743c3309aff1.tar.gz
iced-0f60253661bde4e0a21701c3d004743c3309aff1.tar.bz2
iced-0f60253661bde4e0a21701c3d004743c3309aff1.zip
Merge pull request #260 from 0x7CFE/fix-checkbox-label
Checkbox label is now `Into<String>`
Diffstat (limited to 'native/src/widget/checkbox.rs')
-rw-r--r--native/src/widget/checkbox.rs4
1 files 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, 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,