Add From<PathBuf> to Svg Handle

This commit is contained in:
fogarecious 2024-02-03 21:28:25 +01:00 committed by Héctor Ramón Jiménez
parent 8e76d53803
commit 7bd849199c
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -50,6 +50,15 @@ impl Handle {
}
}
impl<T> From<T> for Handle
where
T: Into<PathBuf>,
{
fn from(path: T) -> Handle {
Handle::from_path(path.into())
}
}
impl Hash for Handle {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.id.hash(state);