Skip to content

Rust 1.95 lints#9142

Merged
mergify[bot] merged 4 commits intosigp:unstablefrom
pawanjay176:1.95-lint
Apr 16, 2026
Merged

Rust 1.95 lints#9142
mergify[bot] merged 4 commits intosigp:unstablefrom
pawanjay176:1.95-lint

Conversation

@pawanjay176
Copy link
Copy Markdown
Member

Issue Addressed

N/A

Proposed Changes

Adds lints for rust 1.95. Mostly cosmetic.

  1. .zip(a.into_iter()) -> .zip(a) . Also a few more places where into_iter is not required
  2. replace sort_by with sort_by_key
  3. move if statements inside match block.
  4. use checked_div instead of if statements. I think this is debatable in terms of being better, happy to remove it if others also feel its unnecessary

@pawanjay176 pawanjay176 requested a review from jxs as a code owner April 16, 2026 18:42
@pawanjay176 pawanjay176 changed the title 1.95 lint Rust 1.95 lints Apr 16, 2026
@pawanjay176 pawanjay176 added the ready-for-review The code is ready for review label Apr 16, 2026
Copy link
Copy Markdown
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Happy to merge and we can come back to fix the UI API (or delete it) in a separate PR

};
let attestation_hit_percentage: f64 = (100 * attestation_hits)
.checked_div(attestations)
.map(|f| f as f64)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separately: isn't this completely pointless? We calculate an integer percentage and then cast it to a float haha

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol true. I assumed precision isn't really a requirement but we need it to be f64 somewhere else haha

@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Apr 16, 2026
@mergify mergify Bot added the queued label Apr 16, 2026
@mergify
Copy link
Copy Markdown

mergify Bot commented Apr 16, 2026

Merge Queue Status

This pull request spent 28 minutes 54 seconds in the queue, including 26 minutes 26 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • check-success=local-testnet-success
  • check-success=test-suite-success

mergify Bot added a commit that referenced this pull request Apr 16, 2026
@mergify mergify Bot merged commit 4cb3ffe into sigp:unstable Apr 16, 2026
39 checks passed
@mergify mergify Bot removed the queued label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge This PR is ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants