Fixed JSON export.
This commit is contained in:
		| @@ -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); | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user