Use closures for TextEditor::style

This commit is contained in:
Héctor Ramón Jiménez 2024-03-12 15:47:37 +01:00
parent 7a5f5b0be7
commit 3e190b9ee0
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 18 additions and 15 deletions

View file

@ -218,12 +218,12 @@ where
/// Creates a new [`TextEditor`].
///
/// [`TextEditor`]: crate::TextEditor
pub fn text_editor<Message, Theme, Renderer>(
content: &text_editor::Content<Renderer>,
) -> TextEditor<'_, core::text::highlighter::PlainText, Message, Theme, Renderer>
pub fn text_editor<'a, Message, Theme, Renderer>(
content: &'a text_editor::Content<Renderer>,
) -> TextEditor<'a, core::text::highlighter::PlainText, Message, Theme, Renderer>
where
Message: Clone,
Theme: text_editor::DefaultStyle,
Theme: text_editor::DefaultStyle + 'a,
Renderer: core::text::Renderer,
{
TextEditor::new(content)