Skip to content

Commit 8a91909

Browse files
committed
fix: fix clippy
1 parent e4ba4f6 commit 8a91909

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/proof.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use circom_prover::{
1616
};
1717
use num_bigint::BigUint;
1818
use num_traits::{Zero, identities::One};
19-
use std::{collections::HashMap, str::FromStr, time::Instant};
19+
use std::{collections::HashMap, str::FromStr};
2020

2121
pub type PackedGroth16Proof = [BigUint; 8];
2222

src/utils.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,12 @@ pub fn download_zkey(depth: u16) -> Result<String, Box<dyn Error>> {
4444
let filename = format!("semaphore-{}.zkey", depth);
4545
let out_dir = std::env::temp_dir();
4646
let dest_path = out_dir.join(filename.clone());
47-
if dest_path.exists() {
48-
return Ok(dest_path.to_string_lossy().into_owned());
47+
if !dest_path.exists() {
48+
let url = format!("{}{}", base_url, filename);
49+
let client = Client::new();
50+
let mut resp = client.get(&url).send()?.error_for_status()?;
51+
let mut out = File::create(&dest_path)?;
52+
copy(&mut resp, &mut out)?;
4953
}
50-
let url = format!("{}{}", base_url, filename);
51-
let client = Client::new();
52-
let mut resp = client.get(&url).send()?.error_for_status()?;
53-
let mut out = File::create(&dest_path)?;
54-
copy(&mut resp, &mut out)?;
55-
eprintln!("Saved as {}", dest_path.display());
5654
Ok(dest_path.to_string_lossy().into_owned())
5755
}

0 commit comments

Comments
 (0)