-
Notifications
You must be signed in to change notification settings - Fork 29
Update to 2024 edition, fix clippy warnings and update to newest libwebp-sys #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I ran tests and used it in my project that depends on this library and didn't get any issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this PR!
There are a couple merge conflicts now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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 { |
Copilot uses AI. Check for mistakes.
All tests passed |
No description provided.