Added extra comments.
This commit is contained in:
parent
aa5702a0a3
commit
cb88b7c3d2
@ -115,9 +115,9 @@ fn main()
|
|||||||
prisoners.push(prisoner_i);
|
prisoners.push(prisoner_i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if any prisoner has not found their number
|
|
||||||
if !opts.json
|
if !opts.json
|
||||||
{
|
{
|
||||||
|
// if any prisoner has not found their number
|
||||||
if prisoners.iter().any(|i| !i.found)
|
if prisoners.iter().any(|i| !i.found)
|
||||||
{
|
{
|
||||||
println!("failure");
|
println!("failure");
|
||||||
@ -129,6 +129,7 @@ fn main()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// export data to JSON format
|
||||||
let out_json = serde_json::to_string(&prisoners).unwrap();
|
let out_json = serde_json::to_string(&prisoners).unwrap();
|
||||||
println!("{}", out_json);
|
println!("{}", out_json);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user