Use ToString for Text::new instead of Into<String>
This commit is contained in:
parent
ff2519b1d4
commit
a1c5f8839d
5 changed files with 13 additions and 12 deletions
|
|
@ -107,7 +107,7 @@ where
|
|||
/// Creates a new [`Text`] widget with the provided content.
|
||||
///
|
||||
/// [`Text`]: widget::Text
|
||||
pub fn text<Renderer>(text: impl Into<String>) -> widget::Text<Renderer>
|
||||
pub fn text<Renderer>(text: impl ToString) -> widget::Text<Renderer>
|
||||
where
|
||||
Renderer: crate::text::Renderer,
|
||||
Renderer::Theme: widget::text::StyleSheet,
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ where
|
|||
Renderer::Theme: StyleSheet,
|
||||
{
|
||||
/// Create a new fragment of [`Text`] with the given contents.
|
||||
pub fn new<T: Into<String>>(label: T) -> Self {
|
||||
pub fn new<T: ToString>(label: T) -> Self {
|
||||
Text {
|
||||
content: label.into(),
|
||||
content: label.to_string(),
|
||||
size: None,
|
||||
font: Default::default(),
|
||||
width: Length::Shrink,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue