Simplify on_paste signature
... and fix spacing.
This commit is contained in:
parent
e8cfa644e7
commit
891b917576
2 changed files with 16 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue