Simplify routes in main.rs

This commit is contained in:
spikecodes 2021-02-24 09:26:01 -08:00
parent 3e567d9acf
commit 4a06882dc8
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
3 changed files with 50 additions and 63 deletions

View file

@ -160,6 +160,7 @@ async fn parse_comments(json: &serde_json::Value, post_link: &str, post_author:
let score = data["score"].as_i64().unwrap_or(0);
let body = rewrite_urls(&val(&comment, "body_html"));
// If this comment contains replies, handle those too
let replies: Vec<Comment> = if data["replies"].is_object() {
parse_comments(&data["replies"], post_link, post_author, highlighted_comment).await
} else {