Skip to content

Commit ce26fbf

Browse files
committed
.
1 parent 251eb4b commit ce26fbf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/post.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,10 @@ fn build_comment(
173173
req: &Request<Body>,
174174
) -> Comment {
175175
let id = val(comment, "id");
176+
let comment_author = val(comment, "author");
177+
let comment_body = val(comment, "body");
176178

177-
let body = if (val(comment, "author") == "[deleted]" && val(comment, "body") == "[removed]") || val(comment, "body") == "[ Removed by Reddit ]" {
179+
let body = if (comment_author == "[deleted]" && comment_body == "[removed]") || comment_body == "[ Removed by Reddit ]" {
178180
format!(
179181
"<div class=\"md\"><p>[removed] — <a href=\"https://{}{post_link}{id}\">view removed comment</a></p></div>",
180182
get_setting("REDLIB_PUSHSHIFT_FRONTEND").unwrap_or_else(|| String::from(crate::config::DEFAULT_PUSHSHIFT_FRONTEND)),
@@ -206,7 +208,7 @@ fn build_comment(
206208
let highlighted = id == highlighted_comment;
207209

208210
let author = Author {
209-
name: val(comment, "author"),
211+
name: comment_author,
210212
flair: Flair {
211213
flair_parts: FlairPart::parse(
212214
data["author_flair_type"].as_str().unwrap_or_default(),

0 commit comments

Comments
 (0)