summaryrefslogtreecommitdiffstats
path: root/native/src/widget/image.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-03-31 17:10:28 +0200
committerLibravatar GitHub <noreply@github.com>2020-03-31 17:10:28 +0200
commit291dc728a42c6e888ca6d97eea0f3308591b15a5 (patch)
treea0830fcff2295779cad6afd7b53175ebecca57da /native/src/widget/image.rs
parent6e9ab1cd6f5358d323040379e3aadbed2cc4f7f8 (diff)
parentf4776a46bbcc2268c1080b6d655fe63cef42b7fd (diff)
downloadiced-291dc728a42c6e888ca6d97eea0f3308591b15a5.tar.gz
iced-291dc728a42c6e888ca6d97eea0f3308591b15a5.tar.bz2
iced-291dc728a42c6e888ca6d97eea0f3308591b15a5.zip
Merge pull request #247 from hecrj/feature/svg-from-memory
Implement `svg::Handle::from_memory`
Diffstat (limited to 'native/src/widget/image.rs')
-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())
}
}