diff options
author | 2020-03-26 16:38:29 +0100 | |
---|---|---|
committer | 2020-03-26 16:38:29 +0100 | |
commit | 893841bfbd7dcf9d1866ec5797403f220f5b544e (patch) | |
tree | 4621dfadc1112682e9ffa60b219c7cc573820cc5 /native | |
parent | 643fa18cae19fa1418a23b652b6b4b8bf8ef79fc (diff) | |
download | iced-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.rs | 13 |
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) } } |