From a2296b466bdb512aeabfed0619ce0f87049717e5 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:43 +0200 Subject: [PATCH] Implement `From` for `canvas::Text` --- wgpu/src/widget/canvas/text.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wgpu/src/widget/canvas/text.rs b/wgpu/src/widget/canvas/text.rs index d1cf1a0f..0589c35d 100644 --- a/wgpu/src/widget/canvas/text.rs +++ b/wgpu/src/widget/canvas/text.rs @@ -32,3 +32,12 @@ impl Default for Text { } } } + +impl From for Text { + fn from(content: String) -> Text { + Text { + content, + ..Default::default() + } + } +}