From 893841bfbd7dcf9d1866ec5797403f220f5b544e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 26 Mar 2020 16:38:29 +0100 Subject: [PATCH] Genericize `From` implementation for `svg::Handle` --- native/src/widget/svg.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/native/src/widget/svg.rs b/native/src/widget/svg.rs index 063730bb..b899da1e 100644 --- a/native/src/widget/svg.rs +++ b/native/src/widget/svg.rs @@ -147,14 +147,11 @@ impl Handle { } } -impl From for Handle { - fn from(path: String) -> Handle { - Handle::from_path(path) - } -} - -impl From<&str> for Handle { - fn from(path: &str) -> Handle { +impl From for Handle +where + T: Into, +{ + fn from(path: T) -> Handle { Handle::from_path(path) } }