Fix Rust beta compiler warnings (rustc 1.75.0-beta.1 (782883f60 2023-11-12)) (#4932)

This commit is contained in:
Jimmy Chen
2023-11-18 03:55:11 +11:00
committed by GitHub
parent 68e076d60a
commit 6b63d18420
20 changed files with 45 additions and 51 deletions

View File

@@ -569,12 +569,12 @@ pub fn serve<T: BeaconChainTypes>(
chain: Arc<BeaconChain<T>>| {
task_spawner.blocking_json_task(Priority::P1, move || {
let (root, execution_optimistic, finalized) = state_id.root(&chain)?;
Ok(root)
.map(api_types::RootData::from)
.map(api_types::GenericResponse::from)
.map(|resp| {
resp.add_execution_optimistic_finalized(execution_optimistic, finalized)
})
Ok(api_types::GenericResponse::from(api_types::RootData::from(
root,
)))
.map(|resp| {
resp.add_execution_optimistic_finalized(execution_optimistic, finalized)
})
})
},
);
@@ -1940,8 +1940,8 @@ pub fn serve<T: BeaconChainTypes>(
.naive_aggregation_pool
.read()
.iter()
.cloned()
.filter(|att| query_filter(&att.data)),
.filter(|&att| query_filter(&att.data))
.cloned(),
);
Ok(api_types::GenericResponse::from(attestations))
})
@@ -2318,11 +2318,9 @@ pub fn serve<T: BeaconChainTypes>(
task_spawner.blocking_json_task(Priority::P1, move || {
let (rewards, execution_optimistic, finalized) =
standard_block_rewards::compute_beacon_block_rewards(chain, block_id)?;
Ok(rewards)
.map(api_types::GenericResponse::from)
.map(|resp| {
resp.add_execution_optimistic_finalized(execution_optimistic, finalized)
})
Ok(api_types::GenericResponse::from(rewards)).map(|resp| {
resp.add_execution_optimistic_finalized(execution_optimistic, finalized)
})
})
},
);
@@ -2435,8 +2433,7 @@ pub fn serve<T: BeaconChainTypes>(
let execution_optimistic =
chain.is_optimistic_or_invalid_head().unwrap_or_default();
Ok(attestation_rewards)
.map(api_types::GenericResponse::from)
Ok(api_types::GenericResponse::from(attestation_rewards))
.map(|resp| resp.add_execution_optimistic(execution_optimistic))
})
},
@@ -2462,11 +2459,9 @@ pub fn serve<T: BeaconChainTypes>(
chain, block_id, validators, log,
)?;
Ok(rewards)
.map(api_types::GenericResponse::from)
.map(|resp| {
resp.add_execution_optimistic_finalized(execution_optimistic, finalized)
})
Ok(api_types::GenericResponse::from(rewards)).map(|resp| {
resp.add_execution_optimistic_finalized(execution_optimistic, finalized)
})
})
},
);