Skip to content

Commit

Permalink
simpler comment formatting
Browse files Browse the repository at this point in the history
Co-authored-by: [email protected]
  • Loading branch information
nain-F49FF806 authored and Mydayyy committed Apr 27, 2024
1 parent 6b6e575 commit a4a88d8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/privatebin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,14 @@ impl Paste {
})
.collect();
json!({
id: {
"comment": decrypted_comments.get(id).unwrap_or(&DecryptedComment::default()).comment,
"nickname": decrypted_comments.get(id).unwrap_or(&DecryptedComment::default()).nickname,
"replies": formatted_children
}
"id": id,
"comment": decrypted_comments.get(id).unwrap_or(&DecryptedComment::default()).comment,
"nickname": decrypted_comments.get(id).unwrap_or(&DecryptedComment::default()).nickname,
"replies": formatted_children
})
}
let top_level = format_comments_below_id(&self.id, decrypted_comments, comment_adjacency);
serde_json::to_string_pretty(&top_level[&self.id]["replies"]).map_err(|e| e.into())
serde_json::to_string_pretty(&top_level["replies"]).map_err(|e| e.into())
}
}

Expand Down

0 comments on commit a4a88d8

Please sign in to comment.