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); } }