Update to 2024 edition, fix clippy warnings and update to newest libwebp-sys#46
Update to 2024 edition, fix clippy warnings and update to newest libwebp-sys#46lucascompython wants to merge 5 commits intojaredforth:mainfrom
Conversation
|
I ran tests and used it in my project that depends on this library and didn't get any issues. |
jaredforth
left a comment
There was a problem hiding this comment.
Thanks for opening this PR!
There are a couple merge conflicts now
There was a problem hiding this comment.
Pull Request Overview
This PR updates the codebase to the 2024 Rust edition, addresses clippy warnings, and updates to a newer version of libwebp-sys. The changes primarily focus on code modernization and following current Rust best practices.
Key changes:
- Updates Rust edition from 2018 to 2024 in Cargo.toml
- Modernizes string formatting to use newer interpolation syntax
- Removes unnecessary explicit dereferences and type conversions
- Updates libwebp-sys dependency from 0.9.3 to 0.13
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Updates edition to 2024 and libwebp-sys to version 0.13 |
| src/shared.rs | Modernizes string formatting and removes unnecessary dereference |
| src/lib.rs | Updates println! to use string interpolation |
| src/encoder.rs | Simplifies function calls and adds unsafe blocks for clarity |
| src/decoder.rs | Updates assertion message formatting |
| src/animation_encoder.rs | Refactors imports, simplifies method calls, and adds unsafe blocks |
| src/animation_decoder.rs | Adds clippy allow directive and implements is_empty method |
| examples/animation_decode.rs | Modernizes loop with enumerate and string formatting |
| examples/animation.rs | Removes unnecessary type cast |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/animation_encoder.rs
Outdated
| impl From<&AnimFrame<'_>> for DynamicImage { | ||
| fn from(val: &AnimFrame<'_>) -> Self { |
There was a problem hiding this comment.
[nitpick] The conversion from Into<DynamicImage> to From<&AnimFrame<'_>> for DynamicImage is correct and follows Rust best practices, but the lifetime parameter should be explicit rather than using the anonymous lifetime '_ in the impl block for better clarity.
| impl From<&AnimFrame<'_>> for DynamicImage { | |
| fn from(val: &AnimFrame<'_>) -> Self { | |
| impl<'a> From<&'a AnimFrame<'a>> for DynamicImage { | |
| fn from(val: &'a AnimFrame<'a>) -> Self { |
|
All tests passed |
No description provided.