Uh oh!
There was an error while loading. Please reload this page.
[RFC] clippy new warnings in rustc 1.86.0 (05f9846f8 2025-03-31) - #3710
Conversation
👋 Thanks for assigning @valentinewallace as a reviewer! |
da14d57 to
3bbf7f0Compare```
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 <vincenzopalazzodev@gmail.com>3bbf7f0 to
19f149eCompareCodecov 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:
|
dunxen
commented
Apr 6, 2025
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 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
dunxen
commented
Apr 7, 2025
Yeah, those changes are correct. I think this might have been applied to |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ldk-reviews-bot
commented
Apr 7, 2025
🔔 1st Reminder Hey @valentinewallace! This PR has been waiting for your review. |
valentinewallace
left a comment
There was a problem hiding this comment.
LGTM after @dunxen's feedback
dcbd7f2 to
80a657eComparewith 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 <vincenzopalazzodev@gmail.com>
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 <vincenzopalazzodev@gmail.com>
80a657e to
4892a57Compare
tnull
left a comment
There was a problem hiding this comment.
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!