Should have fixed index overflow in write_json

pull/5/head
~erin 2021-07-17 18:32:47 -04:00
parent a9dd8088de
commit 8e6663a4df
Signed by: erin
GPG Key ID: DA70E064A8C70F44
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ pub fn write_json(users_list: &Vec<User>) -> Result<()> {
for i in 0..users_list.len() {
// Serialize the users
users_json += &serde_json::to_string(&users_list[i])?;
if i <= users_list.len()-2 { // don't append newline if it's the last element
if i != users_list.len()-1 { // don't append newline if it's the last element
users_json += "\n";
}
}