Genericize From implementation for image::Handle

This commit is contained in:
Héctor Ramón Jiménez 2020-03-31 00:51:59 +02:00
parent ae009158cc
commit f4776a46bb

View file

@ -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())
}
}