summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-31 00:51:59 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-31 00:51:59 +0200
commitf4776a46bbcc2268c1080b6d655fe63cef42b7fd (patch)
treea0830fcff2295779cad6afd7b53175ebecca57da /native
parentae009158cc322b69403a2512ac51582062029c99 (diff)
downloadiced-f4776a46bbcc2268c1080b6d655fe63cef42b7fd.tar.gz
iced-f4776a46bbcc2268c1080b6d655fe63cef42b7fd.tar.bz2
iced-f4776a46bbcc2268c1080b6d655fe63cef42b7fd.zip
Genericize `From` implementation for `image::Handle`
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/image.rs15
1 files changed, 6 insertions, 9 deletions
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<String> 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<T> From<T> for Handle
+where
+ T: Into<PathBuf>,
+{
+ fn from(path: T) -> Handle {
+ Handle::from_path(path.into())
}
}