From 971f14bb5577407c9f37b3c8242d03dc9fa683a1 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Sun, 31 Jan 2021 14:10:13 -0800 Subject: [PATCH] Fix #66 --- src/post.rs | 8 +++++++- src/utils.rs | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/post.rs b/src/post.rs index 7040de3f..f53dd848 100644 --- a/src/post.rs +++ b/src/post.rs @@ -155,6 +155,8 @@ async fn parse_comments(json: &serde_json::Value) -> Vec { Vec::new() }; + dbg!(); + comments.push(Comment { id: val(&comment, "id"), body, @@ -171,7 +173,11 @@ async fn parse_comments(json: &serde_json::Value) -> Vec { }, distinguished: val(&comment, "distinguished"), }, - score: format_num(score), + score: if comment["data"]["score_hidden"].as_bool().unwrap_or_default() { + "•".to_string() + } else { + format_num(score) + }, rel_time, created, replies, diff --git a/src/utils.rs b/src/utils.rs index da6ab3d3..fe399e7b 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -343,7 +343,11 @@ pub async fn fetch_posts(path: &str, fallback_title: String) -> Result<(Vec