Skip to content

Commit

Permalink
Use PathExtensions functions to perform I/O
Browse files Browse the repository at this point in the history
  • Loading branch information
ggiraldez committed Dec 13, 2024
1 parent 4b7b105 commit 6a76d88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/solidity/testing/sanctuary/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fn run_test_command(command: TestCommand) -> Result<()> {
let value = serde_json::to_string(&results)?;

std::fs::create_dir_all(output_path.parent().unwrap())?;
std::fs::write(&output_path, value)?;
output_path.write_string(value)?;
println!("Wrote results to {output_path:?}");
}

Expand Down Expand Up @@ -177,7 +177,7 @@ fn run_in_parallel(files: &Vec<SourceFile>, events: &Events, check_bindings: boo
fn run_show_combined_results_command(command: ShowCombinedResultsCommand) -> Result<()> {
let ShowCombinedResultsCommand { results_file } = command;

let contents = String::from_utf8(std::fs::read(results_file)?)?;
let contents = results_file.read_to_string()?;
let all_results: AllResults = serde_json::from_str(&contents)?;
display_all_results(&all_results);
Ok(())
Expand Down

0 comments on commit 6a76d88

Please sign in to comment.