diff --git a/zero_bin/leader/src/stdio.rs b/zero_bin/leader/src/stdio.rs index 2584a7e32..403ea2a6a 100644 --- a/zero_bin/leader/src/stdio.rs +++ b/zero_bin/leader/src/stdio.rs @@ -3,7 +3,7 @@ use std::io::{Read, Write}; use anyhow::Result; use paladin::runtime::Runtime; use proof_gen::proof_types::GeneratedBlockProof; -use prover::{into_block_prover_input_future, BlockProverInput, BlockProverInputFuture}; +use prover::{BlockProverInput, BlockProverInputFuture}; use tracing::info; /// The main function for the stdio mode. @@ -18,7 +18,7 @@ pub(crate) async fn stdio_main( let des = &mut serde_json::Deserializer::from_str(&buffer); let block_prover_inputs = serde_path_to_error::deserialize::<_, Vec>(des)? .into_iter() - .map(into_block_prover_input_future) + .map(Into::into) .collect::>(); let proved_blocks = prover::prove( diff --git a/zero_bin/prover/src/lib.rs b/zero_bin/prover/src/lib.rs index 3c6c1f85a..2f76fadee 100644 --- a/zero_bin/prover/src/lib.rs +++ b/zero_bin/prover/src/lib.rs @@ -22,11 +22,13 @@ pub type BlockProverInputFuture = std::pin::Pin< Box> + Send>, >; -pub fn into_block_prover_input_future(value: BlockProverInput) -> BlockProverInputFuture { - async fn into(value: BlockProverInput) -> Result { - Ok(value) +impl From for BlockProverInputFuture { + fn from(item: BlockProverInput) -> Self { + async fn into(value: BlockProverInput) -> Result { + Ok(value) + } + Box::pin(into(item)) } - Box::pin(into(value)) } #[derive(Clone, Debug, Deserialize, Serialize)]