Skip to content

Commit d9c50c3

Browse files
committed
feat: format json output
1 parent a7e9baa commit d9c50c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,10 @@ async fn generate_output(
422422
let json_path = Path::new(output_directory).join("report.json");
423423
let mut file = File::create(&json_path)
424424
.expect("Failed to create JSON report file");
425-
file.write_all(json_data.to_string().as_bytes())
425+
let formatted_json = serde_json::to_string_pretty(&json_data)
426+
.expect("Failed to format JSON data");
427+
428+
file.write_all(formatted_json.as_bytes())
426429
.expect("Failed to write JSON data");
427430
}
428431
}

0 commit comments

Comments
 (0)