summaryrefslogtreecommitdiffstats
path: root/pure/src/widget
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 /pure/src/widget
parente8cfa644e726a84c676154f7d0efb369da2a809f (diff)
downloadiced-891b9175769cb0ded3164841393ff599581f332f.tar.gz
iced-891b9175769cb0ded3164841393ff599581f332f.tar.bz2
iced-891b9175769cb0ded3164841393ff599581f332f.zip
Simplify `on_paste` signature
... and fix spacing.
Diffstat (limited to 'pure/src/widget')
-rw-r--r--pure/src/widget/text_input.rs13
1 files changed, 8 insertions, 5 deletions
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