From 46e7cd8a8a9cfd6598ca4a084ace21cd3b60d15e Mon Sep 17 00:00:00 2001 From: okiwi6 <45100017+okiwi6@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:12:25 +0100 Subject: [PATCH] fix ci, change result to expect --- crates/code_generation/src/run.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/code_generation/src/run.rs b/crates/code_generation/src/run.rs index 34c2273d27..b46f565a2c 100644 --- a/crates/code_generation/src/run.rs +++ b/crates/code_generation/src/run.rs @@ -121,14 +121,13 @@ fn generate_recording_thread(cyclers: &Cyclers) -> TokenStream { let instance_name_snake_case = format_ident!("{}", instance.to_case(Case::Snake)); let recording_file_name = format!("{instance}.{{seconds}}.bincode"); let error_message_file = format!("failed to create recording file for {instance}"); - let error_message_folder = format!("failed to create logs folder"); quote! { let recording_file_path = std::path::Path::new("logs").join(format!(#recording_file_name)); std::fs::create_dir_all( recording_file_path.parent() - .ok_or(color_eyre::Report::msg(format!("{} does not have a parent directory", recording_file_path.display())))? - ).wrap_err(#error_message_folder)?; + .expect("recording file path has no parent directory") + ).wrap_err("failed to create logs folder")?; let mut #instance_name_snake_case = std::io::BufWriter::new(std::fs::File::create(recording_file_path).wrap_err(#error_message_file)?); // TODO: possible optimization: buffer size }