diff --git a/src/widget/text_input/input.rs b/src/widget/text_input/input.rs index 0ff27127..b6a50128 100644 --- a/src/widget/text_input/input.rs +++ b/src/widget/text_input/input.rs @@ -195,9 +195,9 @@ pub struct TextInput<'a, Message> { padding: Padding, size: Option, helper_size: f32, - label: Option<&'a str>, - helper_text: Option<&'a str>, - error: Option<&'a str>, + label: Option>, + helper_text: Option>, + error: Option>, on_input: Option Message + 'a>>, on_paste: Option Message + 'a>>, on_submit: Option, @@ -275,14 +275,14 @@ where } /// Sets the text of the [`TextInput`]. - pub fn label(mut self, label: &'a str) -> Self { - self.label = Some(label); + pub fn label(mut self, label: impl Into>) -> Self { + self.label = Some(label.into()); self } /// Sets the helper text of the [`TextInput`]. - pub fn helper_text(mut self, helper_text: &'a str) -> Self { - self.helper_text = Some(helper_text); + pub fn helper_text(mut self, helper_text: impl Into>) -> Self { + self.helper_text = Some(helper_text.into()); self } @@ -293,8 +293,8 @@ where } /// Sets the error message of the [`TextInput`]. - pub fn error(mut self, error: &'a str) -> Self { - self.error = Some(error); + pub fn error(mut self, error: impl Into>) -> Self { + self.error = Some(error.into()); self }