mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 08:52:54 +00:00
Rust 1.86.0 lints (#7254)
Implement lints for the new Rust compiler version 1.86.0.
This commit is contained in:
@@ -760,7 +760,7 @@ impl ProtoArray {
|
||||
///
|
||||
/// - The child is already the best child but it's now invalid due to a FFG change and should be removed.
|
||||
/// - The child is already the best child and the parent is updated with the new
|
||||
/// best-descendant.
|
||||
/// best-descendant.
|
||||
/// - The child is not the best child but becomes the best child.
|
||||
/// - The child is not the best child and does not become the best child.
|
||||
fn maybe_update_best_child_and_descendant<E: EthSpec>(
|
||||
|
||||
@@ -1121,7 +1121,7 @@ mod test_compute_deltas {
|
||||
///
|
||||
/// - `A` (slot 31) is the common descendant.
|
||||
/// - `B` (slot 33) descends from `A`, but there is a single skip slot
|
||||
/// between it and `A`.
|
||||
/// between it and `A`.
|
||||
/// - `C` (slot 32) descends from `A` and conflicts with `B`.
|
||||
///
|
||||
/// Imagine that the `B` chain is finalized at epoch 1. This means that the
|
||||
|
||||
@@ -41,8 +41,8 @@ impl<E: EthSpec> SyncCommitteeContribution<E> {
|
||||
///
|
||||
/// - `message`: A single `SyncCommitteeMessage`.
|
||||
/// - `subcommittee_index`: The subcommittee this contribution pertains to out of the broader
|
||||
/// sync committee. This can be determined from the `SyncSubnetId` of the gossip subnet
|
||||
/// this message was seen on.
|
||||
/// sync committee. This can be determined from the `SyncSubnetId` of the gossip subnet
|
||||
/// this message was seen on.
|
||||
/// - `validator_sync_committee_index`: The index of the validator **within** the subcommittee.
|
||||
pub fn from_message(
|
||||
message: &SyncCommitteeMessage,
|
||||
|
||||
@@ -3,7 +3,7 @@ use smallvec::smallvec;
|
||||
|
||||
impl<N: Unsigned + Clone> TestRandom for BitList<N> {
|
||||
fn random_for_test(rng: &mut impl RngCore) -> Self {
|
||||
let initial_len = std::cmp::max(1, (N::to_usize() + 7) / 8);
|
||||
let initial_len = std::cmp::max(1, N::to_usize().div_ceil(8));
|
||||
let mut raw_bytes = smallvec![0; initial_len];
|
||||
rng.fill_bytes(&mut raw_bytes);
|
||||
|
||||
@@ -24,7 +24,7 @@ impl<N: Unsigned + Clone> TestRandom for BitList<N> {
|
||||
|
||||
impl<N: Unsigned + Clone> TestRandom for BitVector<N> {
|
||||
fn random_for_test(rng: &mut impl RngCore) -> Self {
|
||||
let mut raw_bytes = smallvec![0; std::cmp::max(1, (N::to_usize() + 7) / 8)];
|
||||
let mut raw_bytes = smallvec![0; std::cmp::max(1, N::to_usize().div_ceil(8))];
|
||||
rng.fill_bytes(&mut raw_bytes);
|
||||
// If N isn't divisible by 8
|
||||
// zero out bits greater than N
|
||||
|
||||
Reference in New Issue
Block a user