summaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-13 18:35:41 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-13 18:35:41 +0200
commit891b9175769cb0ded3164841393ff599581f332f (patch)
tree08be8f1805a3a3b314d81262bfb309d08f10665f /native/src
parente8cfa644e726a84c676154f7d0efb369da2a809f (diff)
downloadiced-891b9175769cb0ded3164841393ff599581f332f.tar.gz
iced-891b9175769cb0ded3164841393ff599581f332f.tar.bz2
iced-891b9175769cb0ded3164841393ff599581f332f.zip
Simplify `on_paste` signature
... and fix spacing.
Diffstat (limited to 'native/src')
-rw-r--r--native/src/widget/text_input.rs13
1 files changed, 8 insertions, 5 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