1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00

replace if with safe unwrap

This commit is contained in:
dark64 2022-06-30 16:37:11 +02:00
parent 28566794f1
commit 2ea607226c

View file

@ -192,18 +192,16 @@ fn cli_compute<T: Field, I: Iterator<Item = ir::Statement<T>>>(
.write(writer)
.map_err(|why| format!("Could not save witness: {:?}", why))?;
println!("Witness file written to '{}'", output_path.display());
// write circom witness to file
if let Some(wtns_path) = sub_matches.value_of("circom-witness") {
let wtns_file = File::create(&wtns_path)
.map_err(|why| format!("Could not create {}: {}", output_path.display(), why))?;
let wtns_path = Path::new(sub_matches.value_of("circom-witness").unwrap());
let wtns_file = File::create(&wtns_path)
.map_err(|why| format!("Could not create {}: {}", output_path.display(), why))?;
let mut writer = BufWriter::new(wtns_file);
let mut writer = BufWriter::new(wtns_file);
write_witness(&mut writer, witness, public_inputs)
.map_err(|why| format!("Could not save circom witness: {:?}", why))?;
}
write_witness(&mut writer, witness, public_inputs)
.map_err(|why| format!("Could not save circom witness: {:?}", why))?;
println!("Witness file written to '{}'", output_path.display());
Ok(())
}