Added extra comments.

This commit is contained in:
Nicolás A. Ortega Froysa 2022-07-02 12:12:39 +02:00
parent aa5702a0a3
commit cb88b7c3d2

View File

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