Use closures for Text::style

This commit is contained in:
Héctor Ramón Jiménez 2024-03-12 14:35:55 +01:00
parent 66f81c3429
commit aeb72d528f
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 41 additions and 57 deletions

View file

@ -14,7 +14,7 @@ use crate::rule::{self, Rule};
use crate::runtime::Command;
use crate::scrollable::{self, Scrollable};
use crate::slider::{self, Slider};
use crate::text::Text;
use crate::text::{self, Text};
use crate::text_editor::{self, TextEditor};
use crate::text_input::{self, TextInput};
use crate::toggler::{self, Toggler};
@ -147,6 +147,7 @@ pub fn text<'a, Theme, Renderer>(
text: impl ToString,
) -> Text<'a, Theme, Renderer>
where
Theme: text::DefaultStyle + 'a,
Renderer: core::text::Renderer,
{
Text::new(text.to_string())