From 0a9debfd3f0862f0b5b684e5ac7882f69d196f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Sat, 2 Jul 2022 14:31:14 +0200 Subject: [PATCH] Fixed JSON export. --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 14ba9af..11049f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,6 +26,7 @@ extern crate rand; use structopt::StructOpt; use serde::{Serialize,Deserialize}; +use serde_json::json; // define the commandline parameters #[derive(StructOpt)] @@ -130,7 +131,9 @@ fn main() else { // export data to JSON format - let out_json = serde_json::to_string(&prisoners).unwrap(); + let out_json = json!({ + "prisoners": prisoners + }); println!("{}", out_json); } }