Fix workspace clippy lints#4617
Conversation
- Use rust's Doc comment preferred 4 spaces over tabs. - Use `nth` iterator method instead of combining `skip` and `next`.
- Remove needless borrows. - Collapse collapsible if expression.
- Use Rust's Doc comments preferred 4 spaces over tabs. - Properly indent list items in Rust Doc comments.
- Use `Option` API methods correctly, e.g., `map().flatten()` to `flat_map()`. - Use `matches!` macro for match semantics that evals to bool. - Remove needless borrowing. - Remove needless closures. - Use `u64::MAX` over `u64::max_value()`. - Allow type complexity for `FilterMap`.
|
👋 I see @wpaulino was un-assigned. |
| /// Returns an iterator over all tagged fields with known semantics. | ||
| /// | ||
| /// This is not exported to bindings users as there is not yet a manual mapping for a FilterMap | ||
| #[allow(clippy::type_complexity)] |
There was a problem hiding this comment.
This #[allow(clippy::type_complexity)] is redundant — ci/check-lint.sh already globally suppresses clippy::type_complexity with -A clippy::type_complexity (line 99). Adding per-function #[allow] attributes just adds noise without any effect under the project's CI configuration.
Review SummaryEvery clippy lint fixed in this PR is already suppressed in Cross-referencing each change against
None of these changes affect CI pass/fail. The individual transformations are logically correct (no bugs introduced), but they create unnecessary code churn — particularly the doc comment whitespace changes which touch many lines across multiple files. Inline comments posted:
Cross-cutting concern: If the goal is to clean up these lints, the proper approach would be to fix ALL instances of a given lint workspace-wide, then remove the corresponding |
|
I mean, sure, seems fine to fix modulo claude's above comment. |
The goal is to clean up workspace-wide, but in warning: `lightning` (lib) generated 1951 warnings (123 duplicates)
error: could not compile `lightning` (lib) due to 5 previous errors; 1951 warnings emittedBefore investing effort into that, I think it would be important to know if these lints were supressed intentionally for DX? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4617 +/- ##
==========================================
- Coverage 86.44% 86.43% -0.02%
==========================================
Files 159 159
Lines 109823 109803 -20
Branches 109823 109803 -20
==========================================
- Hits 94941 94903 -38
- Misses 12340 12356 +16
- Partials 2542 2544 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
There's a few that were suppressed cause clippy is outright wrong, but most of them are because clippy wasn't run until way after this repo existed and most clippy lints aren't really worth fixing. I don't think it makes sense to go through the repo and fix 1951 places where clippy is complaining about whitespace (or other unimportant issues). There's probably some individual lints that are worth fixing, but I haven't looked in a while at what we're ignoring that might be worth it. |
Seen those, wouldn't be bothering with that.
I wouldn't be prioritizing these, but the goal here, is it helps me grok the codebase, while also improving what's could be improved upon.
Yeah, going through the allowed lints, there's a couple cases worth fixing that could impact performance and code quality. would start from those. @TheBlueMatt Please I tried pinging you on Discord (Abeeujah). |
Running
cargo clippy --all-features --all-targets --locked -- -D warningstriggers common places code could be improved. This PR fixes thelightning-macrosandlightning-invoicecrate.