summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-26 16:38:29 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-26 16:38:29 +0100
commit893841bfbd7dcf9d1866ec5797403f220f5b544e (patch)
tree4621dfadc1112682e9ffa60b219c7cc573820cc5 /native
parent643fa18cae19fa1418a23b652b6b4b8bf8ef79fc (diff)
downloadiced-893841bfbd7dcf9d1866ec5797403f220f5b544e.tar.gz
iced-893841bfbd7dcf9d1866ec5797403f220f5b544e.tar.bz2
iced-893841bfbd7dcf9d1866ec5797403f220f5b544e.zip
Genericize `From` implementation for `svg::Handle`
Diffstat (limited to 'native')
-rw-r--r--native/src/widget/svg.rs13
1 files 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<String> for Handle {
- fn from(path: String) -> Handle {
- Handle::from_path(path)
- }
-}
-
-impl From<&str> for Handle {
- fn from(path: &str) -> Handle {
+impl<T> From<T> for Handle
+where
+ T: Into<PathBuf>,
+{
+ fn from(path: T) -> Handle {
Handle::from_path(path)
}
}