From a1c5f8839dd972a016e4fd6af3a898c1d8f2684f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 27 Jul 2022 06:56:09 +0200 Subject: Use `ToString` for `Text::new` instead of `Into` --- native/src/widget/helpers.rs | 2 +- native/src/widget/text.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'native/src/widget') diff --git a/native/src/widget/helpers.rs b/native/src/widget/helpers.rs index 648aab5f..a0d39943 100644 --- a/native/src/widget/helpers.rs +++ b/native/src/widget/helpers.rs @@ -107,7 +107,7 @@ where /// Creates a new [`Text`] widget with the provided content. /// /// [`Text`]: widget::Text -pub fn text(text: impl Into) -> widget::Text +pub fn text(text: impl ToString) -> widget::Text where Renderer: crate::text::Renderer, Renderer::Theme: widget::text::StyleSheet, diff --git a/native/src/widget/text.rs b/native/src/widget/text.rs index 26386505..b30f4518 100644 --- a/native/src/widget/text.rs +++ b/native/src/widget/text.rs @@ -45,9 +45,9 @@ where Renderer::Theme: StyleSheet, { /// Create a new fragment of [`Text`] with the given contents. - pub fn new>(label: T) -> Self { + pub fn new(label: T) -> Self { Text { - content: label.into(), + content: label.to_string(), size: None, font: Default::default(), width: Length::Shrink, -- cgit