From 5c923fce4866bcda0d2d2c1023bb046cd92038cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Tue, 14 Apr 2020 06:43:58 +0200 Subject: [PATCH] Implement `From<&str>` for `canvas::Text` --- wgpu/src/widget/canvas/text.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wgpu/src/widget/canvas/text.rs b/wgpu/src/widget/canvas/text.rs index 0589c35d..c4cae30e 100644 --- a/wgpu/src/widget/canvas/text.rs +++ b/wgpu/src/widget/canvas/text.rs @@ -41,3 +41,9 @@ impl From for Text { } } } + +impl From<&str> for Text { + fn from(content: &str) -> Text { + String::from(content).into() + } +}