mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
Fix Rust beta compiler errors (1.77) (#5180)
* Lint fixes * More fixes for beta compiler. * Format fixes * Move `#[allow(dead_code)]` to field level. * Remove old comment. * Update beacon_node/execution_layer/src/test_utils/mod.rs Co-authored-by: João Oliveira <hello@jxs.pt> * remove duplicate line
This commit is contained in:
@@ -26,13 +26,11 @@ pub fn u64_leaf_count(len: usize) -> usize {
|
||||
|
||||
pub fn hash256_iter(
|
||||
values: &[Hash256],
|
||||
) -> impl Iterator<Item = [u8; BYTES_PER_CHUNK]> + ExactSizeIterator + '_ {
|
||||
) -> impl ExactSizeIterator<Item = [u8; BYTES_PER_CHUNK]> + '_ {
|
||||
values.iter().copied().map(Hash256::to_fixed_bytes)
|
||||
}
|
||||
|
||||
pub fn u64_iter(
|
||||
values: &[u64],
|
||||
) -> impl Iterator<Item = [u8; BYTES_PER_CHUNK]> + ExactSizeIterator + '_ {
|
||||
pub fn u64_iter(values: &[u64]) -> impl ExactSizeIterator<Item = [u8; BYTES_PER_CHUNK]> + '_ {
|
||||
let type_size = size_of::<u64>();
|
||||
let vals_per_chunk = BYTES_PER_CHUNK / type_size;
|
||||
values.chunks(vals_per_chunk).map(move |xs| {
|
||||
|
||||
@@ -641,7 +641,7 @@ impl<T: EthSpec> BeaconState<T> {
|
||||
if self.slot() <= decision_slot {
|
||||
Ok(block_root)
|
||||
} else {
|
||||
self.get_block_root(decision_slot).map(|root| *root)
|
||||
self.get_block_root(decision_slot).copied()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -657,7 +657,7 @@ impl<T: EthSpec> BeaconState<T> {
|
||||
if self.slot() == decision_slot {
|
||||
Ok(block_root)
|
||||
} else {
|
||||
self.get_block_root(decision_slot).map(|root| *root)
|
||||
self.get_block_root(decision_slot).copied()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ impl<T: EthSpec> BeaconState<T> {
|
||||
if self.slot() == decision_slot {
|
||||
Ok(block_root)
|
||||
} else {
|
||||
self.get_block_root(decision_slot).map(|root| *root)
|
||||
self.get_block_root(decision_slot).copied()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ impl<'a, N: Unsigned> CachedTreeHash<TreeHashCache> for HistoricalSummaryCache<'
|
||||
|
||||
pub fn leaf_iter(
|
||||
values: &[HistoricalSummary],
|
||||
) -> impl Iterator<Item = [u8; BYTES_PER_CHUNK]> + ExactSizeIterator + '_ {
|
||||
) -> impl ExactSizeIterator<Item = [u8; BYTES_PER_CHUNK]> + '_ {
|
||||
values
|
||||
.iter()
|
||||
.map(|value| value.tree_hash_root())
|
||||
|
||||
@@ -43,7 +43,7 @@ pub fn leaf_count(len: usize) -> usize {
|
||||
|
||||
pub fn leaf_iter(
|
||||
values: &[ParticipationFlags],
|
||||
) -> impl Iterator<Item = [u8; BYTES_PER_CHUNK]> + ExactSizeIterator + '_ {
|
||||
) -> impl ExactSizeIterator<Item = [u8; BYTES_PER_CHUNK]> + '_ {
|
||||
values.chunks(BYTES_PER_CHUNK).map(|xs| {
|
||||
// Zero-pad chunks on the right.
|
||||
let mut chunk = [0u8; BYTES_PER_CHUNK];
|
||||
|
||||
Reference in New Issue
Block a user