From 9a284b68740d3119010cf92b8d7a15797fce299c Mon Sep 17 00:00:00 2001 From: David Klank <155117116+davidjsonn@users.noreply.github.com> Date: Sat, 17 Jan 2026 16:33:00 +0200 Subject: [PATCH] perf: eliminate redundant clones and allocations --- benches/file_db.rs | 4 ++-- ethereum/src/consensus.rs | 2 +- tests/rpc_equivalence.rs | 2 +- verifiable-api/client/src/http.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/benches/file_db.rs b/benches/file_db.rs index 37669c9e7..db898ca4c 100644 --- a/benches/file_db.rs +++ b/benches/file_db.rs @@ -45,12 +45,12 @@ pub fn load_checkpoint(c: &mut Criterion) { let db = FileDB::new(&config).unwrap(); let written_checkpoint = b256!("c7fc7b2f4b548bfc9305fa80bc1865ddc6eea4557f0a80507af5dc34db7bd9ce"); - db.save_checkpoint(written_checkpoint.clone()).unwrap(); + db.save_checkpoint(written_checkpoint).unwrap(); // Then read from the db b.iter(|| { let checkpoint = db.load_checkpoint().unwrap(); - assert_eq!(checkpoint, written_checkpoint.clone()); + assert_eq!(checkpoint, written_checkpoint); }) }); } diff --git a/ethereum/src/consensus.rs b/ethereum/src/consensus.rs index a95046cd7..1f21587a9 100644 --- a/ethereum/src/consensus.rs +++ b/ethereum/src/consensus.rs @@ -204,7 +204,7 @@ impl, DB: Database> ConsensusClient ( let port = get_available_port(); let helios_client = EthereumClientBuilder::new() .network(Network::Mainnet) - .verifiable_api(&format!("http://localhost:{api_port}")) + .verifiable_api(format!("http://localhost:{api_port}")) .unwrap() .consensus_rpc(consensus_rpc) .unwrap() diff --git a/verifiable-api/client/src/http.rs b/verifiable-api/client/src/http.rs index 1a7349f77..f724470a9 100644 --- a/verifiable-api/client/src/http.rs +++ b/verifiable-api/client/src/http.rs @@ -280,7 +280,7 @@ async fn handle_response(response: Response) -> Result { Ok(serde_json::from_slice(&bytes)?) } else { let error_response = response.json::().await?; - Err(eyre!(error_response.error.to_string())) + Err(eyre!(error_response.error)) } }