mirror of
https://github.com/redlib-org/redlib.git
synced 2025-05-04 20:30:37 +00:00
Simplify routes in main.rs
This commit is contained in:
parent
3e567d9acf
commit
4a06882dc8
3 changed files with 50 additions and 63 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue