Skip to content

Commit

Permalink
Fix serialize_to_file
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasgoergens committed Nov 19, 2024
1 parent cf7cdea commit 493a65b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions circ_blocks/examples/zxc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,20 @@ struct RunTimeKnowledge {

impl RunTimeKnowledge {
fn serialize_to_file(&self, benchmark_name: String) -> std::io::Result<()> {
let file_name = format!("../zok_tests/inputs/{}_bin.rtk", benchmark_name);
let dir = "../zok_tests/inputs";
std::fs::create_dir_all(dir)?;
let file_name = format!("{dir}/{benchmark_name}_bin.rtk");
std::fs::create_dir_all("../zok_tests/inputs")?;
let mut f = File::create(file_name)?;
let content = bincode::serialize(&self).unwrap();
f.write(&content)?;
Ok(())
}

fn write_to_file(&self, benchmark_name: String) -> std::io::Result<()> {
let file_name = format!("../zok_tests/inputs/{}.rtk", benchmark_name);
let dir = "../zok_tests/inputs";
std::fs::create_dir_all(dir)?;
let file_name = format!("{dir}/{benchmark_name}.rtk");
let mut f = File::create(file_name)?;
writeln!(
&mut f,
Expand Down

0 comments on commit 493a65b

Please sign in to comment.