refactor(runner): remove unused variables

This commit is contained in:
2026-02-25 16:52:14 +02:00
parent 082add6be0
commit b519c4f059

View File

@@ -200,7 +200,7 @@ async fn run_benchmark(
Ok(()) Ok(())
} }
type ReturnHandle = JoinHandle<(IterationResult, Option<BenchRecord>)>; type ReturnHandle = JoinHandle<miette::Result<BenchRecord>>;
fn spawn_benchmark_tasks( fn spawn_benchmark_tasks(
config: &runner::config::BenchmarkConfig, config: &runner::config::BenchmarkConfig,
@@ -241,20 +241,16 @@ fn spawn_single_iteration(
.await .await
.expect("semaphore should not be closed"); .expect("semaphore should not be closed");
let result = run_iteration(server, payload_bytes, &tls_connector, &server_name) let result = run_iteration(server, payload_bytes, &tls_connector, &server_name).await?;
.await
.expect("iteration should not fail");
let record = BenchRecord { Ok(BenchRecord {
iteration: u64::from(i), iteration: u64::from(i),
mode, mode,
payload_bytes: u64::from(payload_bytes), payload_bytes: u64::from(payload_bytes),
tcp_ns: result.tcp, tcp_ns: result.tcp,
handshake_ns: result.handshake, handshake_ns: result.handshake,
ttlb_ns: result.ttlb, ttlb_ns: result.ttlb,
}; })
(result, Some(record))
}) })
} }
@@ -264,13 +260,11 @@ async fn write_results<W: Write + Send>(
tasks: Vec<ReturnHandle>, tasks: Vec<ReturnHandle>,
) -> miette::Result<()> { ) -> miette::Result<()> {
for task in tasks { for task in tasks {
let (_result, record) = task.await.expect("task should not panic"); let record = task.await.into_diagnostic().context("task paniced")??;
if let Some(record) = record {
writeln!(output, "{record}") writeln!(output, "{record}")
.into_diagnostic() .into_diagnostic()
.context("failed to write record")?; .context("failed to write record")?;
} }
}
Ok(()) Ok(())
} }