summaryrefslogtreecommitdiffstats
path: root/web/src/widget
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/widget')
-rw-r--r--web/src/widget/text.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/src/widget/text.rs b/web/src/widget/text.rs
index 3740af13..1183a3cd 100644
--- a/web/src/widget/text.rs
+++ b/web/src/widget/text.rs
@@ -30,9 +30,9 @@ impl Text {
/// Create a new fragment of [`Text`] with the given contents.
///
/// [`Text`]: struct.Text.html
- pub fn new(label: &str) -> Self {
+ pub fn new<T: Into<String>>(label: T) -> Self {
Text {
- content: String::from(label),
+ content: label.into(),
size: None,
color: None,
font: Font::Default,