Clean Subreddit struct

This commit is contained in:
spikecodes 2021-01-11 16:35:50 -08:00
parent 4d18dc0bb8
commit 6bbc90bc0d
2 changed files with 5 additions and 3 deletions

View File

@ -37,8 +37,10 @@ pub async fn page(req: HttpRequest) -> HttpResponse {
let sub = if !sub_name.contains('+') && sub_name != "popular" && sub_name != "all" { let sub = if !sub_name.contains('+') && sub_name != "popular" && sub_name != "all" {
subreddit(&sub_name).await.unwrap_or_default() subreddit(&sub_name).await.unwrap_or_default()
} else if sub_name.contains('+') { } else if sub_name.contains('+') {
let mut default = Subreddit::default(); Subreddit {
default.name = sub_name; default name: sub_name,
..Subreddit::default()
}
} else { } else {
Subreddit::default() Subreddit::default()
}; };