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:
Pawan Dhananjay
2025-02-23 18:36:13 -08:00
committed by GitHub
parent ff739d56be
commit b3b6aea1c5
33 changed files with 102 additions and 128 deletions

View File

@@ -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();

View File

@@ -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))?
};