Merge pull request #236 from hecrj/improvement/svg-handle-from

Genericize `From` implementation for `svg::Handle`
This commit is contained in:
Héctor Ramón 2020-03-26 19:33:12 +01:00 committed by GitHub
commit 4d3afe2f0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,14 +147,11 @@ impl Handle {
} }
} }
impl From<String> for Handle { impl<T> From<T> for Handle
fn from(path: String) -> Handle { where
Handle::from_path(path) T: Into<PathBuf>,
} {
} fn from(path: T) -> Handle {
impl From<&str> for Handle {
fn from(path: &str) -> Handle {
Handle::from_path(path) Handle::from_path(path)
} }
} }