mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-08 22:28:12 -05:00
src|tests|example: chore clippy
This commit is contained in:
@@ -115,7 +115,7 @@ fn dyn_circuit() {
|
||||
let prover = MockProver::run(K, &circuit, vec![public_inputs]).unwrap();
|
||||
prover.assert_satisfied();
|
||||
|
||||
let title = format!("target/dynamic_circuit_{:0>2}.png", i);
|
||||
let title = format!("target/dynamic_circuit_{i:0>2}.png");
|
||||
let root = BitMapBackend::new(&title, (800, 600)).into_drawing_area();
|
||||
CircuitLayout::default().render(K, &circuit, &root).unwrap();
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ fn jsonrpc_reqrep() -> Result<()> {
|
||||
|res| async move {
|
||||
match res {
|
||||
Ok(()) | Err(Error::RpcServerStopped) => rpcsrv_.stop_connections().await,
|
||||
Err(e) => eprintln!("Failed starting JSON-RPC server: {}", e),
|
||||
Err(e) => eprintln!("Failed starting JSON-RPC server: {e}"),
|
||||
}
|
||||
},
|
||||
Error::RpcServerStopped,
|
||||
@@ -172,7 +172,7 @@ fn http_jsonrpc_reqrep() -> Result<()> {
|
||||
|res| async move {
|
||||
match res {
|
||||
Ok(()) | Err(Error::RpcServerStopped) => rpcsrv_.stop_connections().await,
|
||||
Err(e) => eprintln!("Failed starting JSON-RPC server: {}", e),
|
||||
Err(e) => eprintln!("Failed starting JSON-RPC server: {e}"),
|
||||
}
|
||||
},
|
||||
Error::RpcServerStopped,
|
||||
|
||||
@@ -41,16 +41,16 @@ fn evaluate_vdf() {
|
||||
|
||||
for n_steps in steps {
|
||||
let now = Instant::now();
|
||||
print!("E with N={} ... ", n_steps);
|
||||
print!("E with N={n_steps} ... ");
|
||||
let witness = mimc_vdf::eval(&challenge, n_steps);
|
||||
let eval_elapsed = now.elapsed();
|
||||
println!("{:?}", eval_elapsed);
|
||||
println!("{eval_elapsed:?}");
|
||||
|
||||
let now = Instant::now();
|
||||
print!("V with N={} ... ", n_steps);
|
||||
print!("V with N={n_steps} ... ");
|
||||
assert!(mimc_vdf::verify(&challenge, n_steps, &witness));
|
||||
let verify_elapsed = now.elapsed();
|
||||
println!("{:?}", verify_elapsed);
|
||||
println!("{verify_elapsed:?}");
|
||||
|
||||
map.insert(n_steps, (eval_elapsed, verify_elapsed));
|
||||
}
|
||||
@@ -60,8 +60,8 @@ fn evaluate_vdf() {
|
||||
table.set_titles(row!["n_steps", "eval time", "verify time"]);
|
||||
for n_steps in steps {
|
||||
let (eval, verify) = map.get(&n_steps).unwrap();
|
||||
table.add_row(row![format!("{}", n_steps), format!("{:?}", eval), format!("{:?}", verify)]);
|
||||
table.add_row(row![format!("{n_steps}"), format!("{eval:?}"), format!("{verify:?}")]);
|
||||
}
|
||||
|
||||
println!("\n\n{}", table);
|
||||
println!("\n\n{table}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user