-
Notifications
You must be signed in to change notification settings - Fork 403
[RFC] clippy new warnings in rustc 1.86.0 (05f9846f8 2025-03-31) #3710
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
👋 Thanks for assigning @valentinewallace as a reviewer! |
da14d57
to
3bbf7f0
Compare
``` error: manual implementation of `ok` --> lightning/src/ln/channel.rs:8551:3 | 8551 | / match self.sign_channel_announcement(node_signer, announcement) { 8552 | | Ok(res) => Some(res), 8553 | | Err(_) => None, 8554 | | } | |_________^ help: replace with: `self.sign_channel_announcement(node_signer, announcement).ok()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err = note: `-D clippy::manual-ok-err` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::manual_ok_err)]` ``` Signed-off-by: Vincenzo Palazzo <[email protected]>
3bbf7f0
to
19f149e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3710 +/- ##
==========================================
- Coverage 89.04% 89.04% -0.01%
==========================================
Files 155 155
Lines 122019 122017 -2
Branches 122019 122017 -2
==========================================
- Hits 108652 108647 -5
- Misses 10701 10710 +9
+ Partials 2666 2660 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The changes seem minimal and the formatting is being properly corrected, because it's aligning further lines with the leading backtick, unlike before where those instance were aligned with the first letter. So this LGTM |
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.
Hmm, I'm a bit confused why we need to touch features.rs
once more, wasn't this solved in #3704 ?
Yeah, those changes are correct. I think this might have been applied to |
🔔 1st Reminder Hey @valentinewallace! This PR has been waiting for your review. |
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.
LGTM after @dunxen's feedback
dcbd7f2
to
80a657e
Compare
with recent rustc version we can use `repeat_n` instead of `repeat().take()` ``` error: this `repeat().take()` can be written more concisely --> lightning-invoice/src/ser.rs:256:12 | 256 | Box::new(core::iter::repeat(Fe32::Q).take(to_pad).chain(fes)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `core::iter::repeat_n(Fe32::Q, to_pad)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n = note: `-D clippy::manual-repeat-n` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::manual_repeat_n)]` ``` but to keep compatibility with older rustc versions we need to disable the warning for the `repeat_n` lint. Signed-off-by: Vincenzo Palazzo <[email protected]>
This is the most opinonated suggestion in this sequence of patches. Probably IDK if would be an option disable this check, but for now this commit propose a formatting fix to make clippy happy. ``` error: doc list item overindented --> lightning-types/src/features.rs:62:5 | 62 | //! onion. | ^^^ help: try using ` ` (2 spaces) | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items = note: `-D clippy::doc-overindented-list-items` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::doc_overindented_list_items)]` error: doc list item overindented --> lightning-types/src/features.rs:63:5 | 63 | //! (see [BOLT-11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) for | ^^^ help: try using ` ` (2 spaces) | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items error: doc list item overindented --> lightning-types/src/features.rs:64:5 | 64 | //! more). | ^^^ help: try using ` ` (2 spaces) | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items error: doc list item overindented --> lightning-types/src/features.rs:66:5 | 66 | //! (see | ^^^ help: try using ` ` (2 spaces) | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items error: doc list item overindented --> lightning-types/src/features.rs:67:5 | 67 | //! [BOLT-2](https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message) | ^^^ help: try using ` ` (2 spaces) | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items error: doc list item overindented --> lightning-types/src/features.rs:68:5 | 68 | //! for more info). | ^^^ help: try using ` ` (2 spaces) | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items error: could not compile `lightning-types` (lib) due to 6 previous errors ``` Suggested-by: @dunxen Signed-off-by: Vincenzo Palazzo <[email protected]>
80a657e
to
4892a57
Compare
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.
LGTM, going ahead and landing this as generally trivial and the diff to previous ACKs is minimal.
I was using an older version of the compiler, and Clippy did not report any issues. However, after updating to Rust 1.86.0, I was able to reproduce the warnings that we are having inside the CI. This patch proposes an opinionated solution that aligns with Clippy’s suggestions, but I am open to disabling some of the warnings if needed.
The commits include specific changes to highlight the errors, making the review process easier.
Probably @TheBlueMatt will have some opinion on this!