From d9c50c3201c8ef4dc8b23e217c831caf5f85d409 Mon Sep 17 00:00:00 2001 From: "Azat S." Date: Thu, 31 Oct 2024 19:02:29 +0300 Subject: [PATCH] feat: format json output --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c081c1e..e99bc28 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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"); } }