Update src/post.rs

Co-authored-by: Matthew Esposito <matt@matthew.science>
This commit is contained in:
Daniel Valentine 2023-03-08 21:24:52 -07:00 committed by GitHub
parent 0814e7c706
commit d4b594c601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ fn parse_comments(json: &serde_json::Value, post_link: &str, post_author: &str,
// The "kind" value will be "more" and the "count"
// shows how many more (sub-)comments exist in the respective nesting level.
// Note that in certain (seemingly random) cases, the count is simply wrong.
let more_count = data["count"].as_i64().unwrap_or(0);
let more_count = data["count"].as_i64().unwrap_or_default();
// If this comment contains replies, handle those too
let replies: Vec<Comment> = if data["replies"].is_object() {