summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-03-26 19:33:12 +0100
committerLibravatar GitHub <noreply@github.com>2020-03-26 19:33:12 +0100
commit4d3afe2f0c6d42bb86248c1dbf5c5188e2b9e9ba (patch)
tree6ffccb310c1d9d62275957f5df91b7ba8f86139a /native
parent9ef1801ed647868b624f1e1999141e74a292b980 (diff)
parent893841bfbd7dcf9d1866ec5797403f220f5b544e (diff)
downloadiced-4d3afe2f0c6d42bb86248c1dbf5c5188e2b9e9ba.tar.gz
iced-4d3afe2f0c6d42bb86248c1dbf5c5188e2b9e9ba.tar.bz2
iced-4d3afe2f0c6d42bb86248c1dbf5c5188e2b9e9ba.zip
Merge pull request #236 from hecrj/improvement/svg-handle-from
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)
}
}