Skip to content

Commit

Permalink
feat: format json output
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Oct 31, 2024
1 parent a7e9baa commit d9c50c3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,10 @@ async fn generate_output(
let json_path = Path::new(output_directory).join("report.json");
let mut file = File::create(&json_path)
.expect("Failed to create JSON report file");
file.write_all(json_data.to_string().as_bytes())
let formatted_json = serde_json::to_string_pretty(&json_data)
.expect("Failed to format JSON data");

file.write_all(formatted_json.as_bytes())
.expect("Failed to write JSON data");
}
}
Expand Down

0 comments on commit d9c50c3

Please sign in to comment.