Skip to content

Commit

Permalink
Merge pull request #2235 from fogarecious/add-from-pathbuf-to-svg-handle
Browse files Browse the repository at this point in the history
Make the svg function to accept a path
  • Loading branch information
hecrj authored Feb 5, 2024
2 parents 8e76d53 + f2e904f commit b5b267c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `Custom` variant to `command::Action`. [#2146](https://github.com/iced-rs/iced/pull/2146)
- Mouse movement events for `MouseArea`. [#2147](https://github.com/iced-rs/iced/pull/2147)
- Dracula, Nord, Solarized, and Gruvbox variants for `Theme`. [#2170](https://github.com/iced-rs/iced/pull/2170)
- `From<T> where T: Into<PathBuf>` for `svg::Handle`. [#2235](https://github.com/iced-rs/iced/pull/2235)

### Changed
- Enable WebGPU backend in `wgpu` by default instead of WebGL. [#2068](https://github.com/iced-rs/iced/pull/2068)
Expand Down Expand Up @@ -108,6 +109,7 @@ Many thanks to...
- @Decodetalkers
- @derezzedex
- @dtzxporter
- @fogarecious
- @GyulyVGC
- @hicaru
- @ids1024
Expand Down
9 changes: 9 additions & 0 deletions core/src/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b5b267c

Please sign in to comment.