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.is_secure = true;
|
||||||
self
|
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
|
/// Sets the message that should be produced when some text is pasted into
|
||||||
where
|
/// the [`TextInput`].
|
||||||
OnPaste: 'a + Fn(String) -> Message,
|
pub fn on_paste(
|
||||||
{
|
mut self,
|
||||||
|
on_paste: impl Fn(String) -> Message + 'a,
|
||||||
|
) -> Self {
|
||||||
self.on_paste = Some(Box::new(on_paste));
|
self.on_paste = Some(Box::new(on_paste));
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the [`Font`] of the [`TextInput`].
|
/// Sets the [`Font`] of the [`TextInput`].
|
||||||
///
|
///
|
||||||
/// [`Font`]: crate::text::Renderer::Font
|
/// [`Font`]: crate::text::Renderer::Font
|
||||||
|
|
|
||||||
|
|
@ -87,14 +87,17 @@ where
|
||||||
self.is_secure = true;
|
self.is_secure = true;
|
||||||
self
|
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
|
/// Sets the message that should be produced when some text is pasted into
|
||||||
where
|
/// the [`TextInput`].
|
||||||
OnPaste: 'a + Fn(String) -> Message,
|
pub fn on_paste(
|
||||||
{
|
mut self,
|
||||||
|
on_paste: impl Fn(String) -> Message + 'a,
|
||||||
|
) -> Self {
|
||||||
self.on_paste = Some(Box::new(on_paste));
|
self.on_paste = Some(Box::new(on_paste));
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the [`Font`] of the [`TextInput`].
|
/// Sets the [`Font`] of the [`TextInput`].
|
||||||
///
|
///
|
||||||
/// [`Font`]: text::Renderer::Font
|
/// [`Font`]: text::Renderer::Font
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue