Closed ktechmidas closed 1 month ago
The pull request introduces a new dependency to the Cargo.toml
file for the dash-evo-tool
package, specifically adding rust-embed
version 6.4.0
. Additionally, it modifies the left_panel.rs
file by implementing a new struct called Assets
, which uses the RustEmbed
crate to manage icon assets. The image loading mechanism is updated to retrieve images from embedded assets instead of file paths, enhancing error handling to provide more specific messages when assets are not found.
File | Change Summary |
---|---|
Cargo.toml | Added new dependency: rust-embed = "6.4.0" |
src/ui/components/left_panel.rs | Introduced new struct Assets to embed icon assets. Modified load_icon to use embedded assets instead of file paths, with updated error handling. |
sequenceDiagram
participant User
participant UI
participant Assets
User->>UI: Request to load icon
UI->>Assets: Attempt to retrieve icon
alt Icon found
Assets-->>UI: Return embedded icon
UI-->>User: Display icon
else Icon not found
Assets-->>UI: Return error message
UI-->>User: Display error message
end
🐇 In a world of code, so bright and new,
A rabbit hops in, with changes to view.
With icons embedded, no paths to roam,
Rust-embed brings assets right into our home.
Errors now clearer, a joy to behold,
In the land of the code, our story unfolds! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This should fix the issue in the final release binaries where we cannot load the icons/images for the sidebar in the application
Summary by CodeRabbit
New Features
Assets
struct to embed icon assets directly into the application, improving loading efficiency.Bug Fixes
Chores
rust-embed
version6.4.0
.