Skip to content

Commit 652d78c

Browse files
committed
style: cargo clippy
1 parent ff67963 commit 652d78c

File tree

9 files changed

+14
-13
lines changed

9 files changed

+14
-13
lines changed

bin/host/src/cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl HostArgs {
5757
let (rpc_url, chain_id) = match (self.provider.rpc_url.clone(), self.provider.chain_id) {
5858
(Some(rpc_url), Some(chain_id)) => (Some(rpc_url), chain_id),
5959
(None, Some(chain_id)) => {
60-
match std::env::var(format!("RPC_{}", chain_id)) {
60+
match std::env::var(format!("RPC_{chain_id}")) {
6161
Ok(rpc_env_var) => {
6262
// We don't always need it but if the value exists it has to be valid.
6363
(Some(Url::parse(rpc_env_var.as_str())?), chain_id)
@@ -79,7 +79,7 @@ impl HostArgs {
7979
}
8080
};
8181
let debug_rpc_url = self.provider.debug_rpc_url.clone().or_else(|| {
82-
std::env::var(format!("DEBUG_RPC_{}", chain_id))
82+
std::env::var(format!("DEBUG_RPC_{chain_id}"))
8383
.ok()
8484
.and_then(|url| Url::parse(&url).ok())
8585
});

crates/executor/guest/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ use executor::{EthClientExecutor, DESERIALZE_INPUTS};
1717
use io::EthClientExecutorInput;
1818
use std::sync::Arc;
1919

20-
pub fn verify_block(input: &Vec<u8>) -> (B256, B256, B256) {
21-
println!("cycle-tracker-report-start: {}", DESERIALZE_INPUTS);
20+
pub fn verify_block(input: &[u8]) -> (B256, B256, B256) {
21+
println!("cycle-tracker-report-start: {DESERIALZE_INPUTS}");
2222
let input = bincode::deserialize::<EthClientExecutorInput>(input).unwrap();
23-
println!("cycle-tracker-report-end: {}", DESERIALZE_INPUTS);
23+
println!("cycle-tracker-report-end: {DESERIALZE_INPUTS}");
2424

2525
// Execute the block.
2626
let executor = EthClientExecutor::eth(

crates/executor/host/src/alerting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl AlertingClient {
2727
event_action: "trigger".to_string(),
2828
};
2929

30-
match self.client.post(format!("{}/enqueue", PAGER_DUTY_ENDPOINT)).json(&alert).send().await
30+
match self.client.post(format!("{PAGER_DUTY_ENDPOINT}/enqueue")).json(&alert).send().await
3131
{
3232
Ok(response) => {
3333
if let Err(err) = response.error_for_status() {

crates/executor/host/src/bins/persist_report_hook.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl ExecutionHooks for PersistExecutionReport {
198198
executed_block: &Block<P::SignedTx>,
199199
execution_report: &ExecutionReport,
200200
) -> eyre::Result<()> {
201-
println!("\nExecution report:\n{}", execution_report);
201+
println!("\nExecution report:\n{execution_report}");
202202

203203
// Open the file for appending or create it if it doesn't exist
204204
let file = OpenOptions::new().append(true).create(true).open(self.report_path.clone())?;

crates/executor/host/src/full_executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ where
306306
std::fs::create_dir_all(&input_folder)?;
307307
}
308308

309-
let input_path = input_folder.join(format!("{}.bin", block_number));
309+
let input_path = input_folder.join(format!("{block_number}.bin"));
310310
let mut cache_file = std::fs::File::create(input_path)?;
311311

312312
bincode::serialize_into(&mut cache_file, &client_input)?;
@@ -450,7 +450,7 @@ fn try_load_input_from_cache<P: NodePrimitives + DeserializeOwned>(
450450
chain_id: u64,
451451
block_number: u64,
452452
) -> eyre::Result<Option<ClientExecutorInput<P>>> {
453-
let cache_path = cache_dir.join(format!("input/{}/{}.bin", chain_id, block_number));
453+
let cache_path = cache_dir.join(format!("input/{chain_id}/{block_number}.bin"));
454454

455455
if cache_path.exists() {
456456
// TODO: prune the cache if invalid instead

crates/executor/host/src/hooks.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub trait ExecutionHooks: Send {
2424
async { Ok(()) }
2525
}
2626

27+
#[allow(clippy::too_many_arguments)]
2728
fn on_proving_end(
2829
&self,
2930
_block_number: u64,

crates/executor/host/src/host_executor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<C: ConfigureEvm> HostExecutor<C> {
184184
})
185185
});
186186

187-
let after_tasks = state_requests.iter().map(|(address, _)| {
187+
let after_tasks = state_requests.keys().map(|address| {
188188
let permit = semaphore.clone().acquire_owned();
189189
let provider = provider.clone();
190190
let address = *address;

crates/executor/host/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use zkm_sdk::ZKMStdin;
33
/// Dump the program and stdin to files for debugging if `ZKM_DUMP` is set.
44
pub(crate) fn zkm_dump(elf: &[u8], stdin: &ZKMStdin, block: u64) {
55
if std::env::var("ZKM_DUMP").map(|v| v == "1" || v.to_lowercase() == "true").unwrap_or(false) {
6-
std::fs::write(format!("{}-program.bin", block), elf).unwrap();
6+
std::fs::write(format!("{block}-program.bin"), elf).unwrap();
77
let stdin = bincode::serialize(&stdin).unwrap();
8-
std::fs::write(format!("{}-stdin.bin", block), stdin.clone()).unwrap();
8+
std::fs::write(format!("{block}-stdin.bin"), stdin.clone()).unwrap();
99
}
1010
}

crates/storage/rpc-db/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl<P: Provider<N> + Clone, N: Network> RpcDb<P, N> {
217217
info!("Preloading accounts and storage for block: {}", self.block);
218218
let current_block = self.block.as_u64().unwrap() + 1;
219219
let params = (
220-
format!("0x{:x}", current_block),
220+
format!("0x{current_block:x}"),
221221
serde_json::json!({
222222
"disableStorage": false,
223223
"disableMemory": true,

0 commit comments

Comments
 (0)