-
-
Notifications
You must be signed in to change notification settings - Fork 3k
chore(ksud): enable clippy::all, clippy::pedantic && make clippy happy #2970
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
Conversation
https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pub_crate ... and use some #![allow(...)] or #[allow(...)] Signed-off-by: Tools-app <[email protected]>
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 enables stricter Rust linting with clippy::all and clippy::pedantic, then addresses the resulting warnings to improve code quality and maintainability. The changes focus on modernizing Rust idioms, improving formatting consistency, and eliminating deprecated patterns.
- Enabled strict clippy lints (
clippy::all,clippy::pedantic) with targeted exceptions for legitimate cases - Updated to modern Rust patterns (e.g.,
&raw const/&raw mutsyntax,is_some_and,map_or_else) - Improved code readability through better formatting (inline format arguments,
Selfusage,.display()for paths)
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| main.rs | Added clippy lint configuration with #![deny] and selective #![allow] attributes |
| su.rs | Changed parameter passing to use references, simplified control flow, and updated to map_or_else |
| sepolicy.rs | Used Self in enums, made functions const, updated to raw pointer syntax, and improved formatting |
| profile.rs | Removed unnecessary semicolons and changed to use .display() for paths |
| module_config.rs | Made functions const, used Self in matches, improved path formatting with .display() |
| module.rs | Changed visibility from pub(crate) to pub, renamed internal functions, improved formatting |
| metamodule.rs | Changed visibility, simplified nested conditionals, improved path formatting |
| init_event.rs | Changed return types from Result<()> to (), updated slice parameters |
| feature.rs | Changed parameters from String to &str, made functions const, removed unnecessary returns |
| debug.rs | Simplified control flow and improved inline formatting |
| cli.rs | Adjusted imports, adapted to function signature changes |
| boot_patch.rs | Added #![allow] attributes, improved formatting, simplified conditional logic |
| ksucalls.rs | Updated to modern &raw const/&raw mut pointer syntax |
| assets.rs | Changed return types, updated to ok_or_else |
| apk_sign.rs | Updated to use ok_or_else for lazy evaluation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tiann#2970) https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pub_crate ... and use some #![allow(...)] or #[allow(...)] --------- Signed-off-by: Tools-app <[email protected]> Co-authored-by: weishu <[email protected]>
tiann#2970) https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pub_crate ... and use some #![allow(...)] or #[allow(...)] --------- Signed-off-by: Tools-app <[email protected]> Co-authored-by: weishu <[email protected]>
tiann#2970) https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pub_crate ... and use some #![allow(...)] or #[allow(...)] --------- Signed-off-by: Tools-app <[email protected]> Co-authored-by: weishu <[email protected]>
https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pub_crate ...
and use some #![allow(...)] or #[allow(...)]