summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--native/src/widget/text_input.rs13
-rw-r--r--pure/src/widget/text_input.rs13
2 files changed, 16 insertions, 10 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs
index c131cc77..9fc09b5d 100644
--- a/native/src/widget/text_input.rs
+++ b/native/src/widget/text_input.rs
@@ -114,14 +114,17 @@ where
self.is_secure = true;
self
}
- /// Set's the message that should be produced when a message is pasted into the [`TextInput`].
- pub fn on_paste<OnPaste>(mut self, on_paste: OnPaste) -> Self
- where
- OnPaste: 'a + Fn(String) -> Message,
- {
+
+ /// Sets the message that should be produced when some text is pasted into
+ /// the [`TextInput`].
+ pub fn on_paste(
+ mut self,
+ on_paste: impl Fn(String) -> Message + 'a,
+ ) -> Self {
self.on_paste = Some(Box::new(on_paste));
self
}
+
/// Sets the [`Font`] of the [`TextInput`].
///
/// [`Font`]: crate::text::Renderer::Font
diff --git a/pure/src/widget/text_input.rs b/pure/src/widget/text_input.rs
index 88726a52..34edef28 100644
--- a/pure/src/widget/text_input.rs
+++ b/pure/src/widget/text_input.rs
@@ -87,14 +87,17 @@ where
self.is_secure = true;
self
}
- /// Set's the message that should be produced when a message is pasted into the [`TextInput`].
- pub fn on_paste<OnPaste>(mut self, on_paste: OnPaste) -> Self
- where
- OnPaste: 'a + Fn(String) -> Message,
- {
+
+ /// Sets the message that should be produced when some text is pasted into
+ /// the [`TextInput`].
+ pub fn on_paste(
+ mut self,
+ on_paste: impl Fn(String) -> Message + 'a,
+ ) -> Self {
self.on_paste = Some(Box::new(on_paste));
self
}
+
/// Sets the [`Font`] of the [`TextInput`].
///
/// [`Font`]: text::Renderer::Font