Parse GIFs correctly

This commit is contained in:
spikecodes 2021-01-11 17:47:14 -08:00
parent 7a33ed3434
commit 541c741bde
4 changed files with 14 additions and 40 deletions

View file

@ -62,7 +62,7 @@ async fn user(name: &str) -> Result<User, &'static str> {
Ok(User {
name: name.to_string(),
title: nested_val(&res, "subreddit", "title"),
icon: format_url(nested_val(&res, "subreddit", "icon_img")),
icon: format_url(nested_val(&res, "subreddit", "icon_img").as_str()),
karma: res["data"]["total_karma"].as_i64().unwrap_or(0),
created: OffsetDateTime::from_unix_timestamp(created).format("%b %d '%y"),
banner: nested_val(&res, "subreddit", "banner_img"),