mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 21:38:31 +00:00
Rust clippy 1.87 lint fixes (#7471)
Fix clippy lints for `rustc` 1.87 clippy complains about `BeaconChainError` being too large. I went on a bit of a boxing spree because of this. We may instead want to `Box` some of the `BeaconChainError` variants?
This commit is contained in:
@@ -123,8 +123,9 @@ pub async fn publish_block<T: BeaconChainTypes, B: IntoGossipVerifiedBlock<T>>(
|
||||
"Signed block published to network via HTTP API"
|
||||
);
|
||||
|
||||
crate::publish_pubsub_message(&sender, PubsubMessage::BeaconBlock(block.clone()))
|
||||
.map_err(|_| BlockError::BeaconChainError(BeaconChainError::UnableToPublish))?;
|
||||
crate::publish_pubsub_message(&sender, PubsubMessage::BeaconBlock(block.clone())).map_err(
|
||||
|_| BlockError::BeaconChainError(Box::new(BeaconChainError::UnableToPublish)),
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
};
|
||||
@@ -506,7 +507,7 @@ fn publish_blob_sidecars<T: BeaconChainTypes>(
|
||||
) -> Result<(), BlockError> {
|
||||
let pubsub_message = PubsubMessage::BlobSidecar(Box::new((blob.index(), blob.clone_blob())));
|
||||
crate::publish_pubsub_message(sender_clone, pubsub_message)
|
||||
.map_err(|_| BlockError::BeaconChainError(BeaconChainError::UnableToPublish))
|
||||
.map_err(|_| BlockError::BeaconChainError(Box::new(BeaconChainError::UnableToPublish)))
|
||||
}
|
||||
|
||||
fn publish_column_sidecars<T: BeaconChainTypes>(
|
||||
@@ -536,7 +537,7 @@ fn publish_column_sidecars<T: BeaconChainTypes>(
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
crate::publish_pubsub_messages(sender_clone, pubsub_messages)
|
||||
.map_err(|_| BlockError::BeaconChainError(BeaconChainError::UnableToPublish))
|
||||
.map_err(|_| BlockError::BeaconChainError(Box::new(BeaconChainError::UnableToPublish)))
|
||||
}
|
||||
|
||||
async fn post_block_import_logging_and_response<T: BeaconChainTypes>(
|
||||
@@ -593,7 +594,9 @@ async fn post_block_import_logging_and_response<T: BeaconChainTypes>(
|
||||
Err(warp_utils::reject::custom_bad_request(msg))
|
||||
}
|
||||
}
|
||||
Err(BlockError::BeaconChainError(BeaconChainError::UnableToPublish)) => {
|
||||
Err(BlockError::BeaconChainError(e))
|
||||
if matches!(e.as_ref(), BeaconChainError::UnableToPublish) =>
|
||||
{
|
||||
Err(warp_utils::reject::custom_server_error(
|
||||
"unable to publish to network channel".to_string(),
|
||||
))
|
||||
@@ -789,7 +792,7 @@ fn check_slashable<T: BeaconChainTypes>(
|
||||
block_clone.message().proposer_index(),
|
||||
block_root,
|
||||
)
|
||||
.map_err(|e| BlockError::BeaconChainError(e.into()))?
|
||||
.map_err(|e| BlockError::BeaconChainError(Box::new(e.into())))?
|
||||
{
|
||||
warn!(
|
||||
slot = %block_clone.slot(),
|
||||
|
||||
Reference in New Issue
Block a user