diff options
author | 2020-03-31 17:10:28 +0200 | |
---|---|---|
committer | 2020-03-31 17:10:28 +0200 | |
commit | 291dc728a42c6e888ca6d97eea0f3308591b15a5 (patch) | |
tree | a0830fcff2295779cad6afd7b53175ebecca57da /native/src/widget/image.rs | |
parent | 6e9ab1cd6f5358d323040379e3aadbed2cc4f7f8 (diff) | |
parent | f4776a46bbcc2268c1080b6d655fe63cef42b7fd (diff) | |
download | iced-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.rs | 15 |
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()) } } |