From f4776a46bbcc2268c1080b6d655fe63cef42b7fd Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 31 Mar 2020 00:51:59 +0200 Subject: Genericize `From` implementation for `image::Handle` --- native/src/widget/image.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'native/src/widget/image.rs') diff --git a/native/src/widget/image.rs b/native/src/widget/image.rs index 9dc13fa9..0f38a90e 100644 --- a/native/src/widget/image.rs +++ b/native/src/widget/image.rs @@ -177,15 +177,12 @@ 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 { - Handle::from_path(path) +impl From for Handle +where + T: Into, +{ + fn from(path: T) -> Handle { + Handle::from_path(path.into()) } } -- cgit