From cb88b7c3d21b70e251f7c65dc2fd5f59d6c19afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Sat, 2 Jul 2022 12:12:39 +0200 Subject: [PATCH] Added extra comments. --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 4673916..14ba9af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,9 +115,9 @@ fn main() prisoners.push(prisoner_i); } - // if any prisoner has not found their number if !opts.json { + // if any prisoner has not found their number if prisoners.iter().any(|i| !i.found) { println!("failure"); @@ -129,6 +129,7 @@ fn main() } else { + // export data to JSON format let out_json = serde_json::to_string(&prisoners).unwrap(); println!("{}", out_json); }