mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 12:58:31 +00:00
Rust 1.85 lints (#7019)
N/A 2 changes: 1. Replace Option::map_or(true, ...) with is_none_or(...) 2. Remove unnecessary `Into::into` blocks where the type conversion is apparent from the types
This commit is contained in:
@@ -971,6 +971,7 @@ impl<E: EthSpec> From<BeaconBlockBody<E, FullPayload<E>>>
|
||||
Option<ExecutionPayload<E>>,
|
||||
)
|
||||
{
|
||||
#[allow(clippy::useless_conversion)] // Not a useless conversion
|
||||
fn from(body: BeaconBlockBody<E, FullPayload<E>>) -> Self {
|
||||
map_beacon_block_body!(body, |inner, cons| {
|
||||
let (block, payload) = inner.into();
|
||||
|
||||
@@ -134,13 +134,13 @@ impl<T: Decode> RuntimeVariableList<T> {
|
||||
)));
|
||||
}
|
||||
|
||||
bytes
|
||||
.chunks(<T as Decode>::ssz_fixed_len())
|
||||
.try_fold(Vec::with_capacity(num_items), |mut vec, chunk| {
|
||||
bytes.chunks(<T as Decode>::ssz_fixed_len()).try_fold(
|
||||
Vec::with_capacity(num_items),
|
||||
|mut vec, chunk| {
|
||||
vec.push(<T as Decode>::from_ssz_bytes(chunk)?);
|
||||
Ok(vec)
|
||||
})
|
||||
.map(Into::into)?
|
||||
},
|
||||
)?
|
||||
} else {
|
||||
ssz::decode_list_of_variable_length_items(bytes, Some(max_len))?
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user