Optimize use of Result<>

This commit is contained in:
spikecodes 2021-01-06 21:27:24 -08:00
parent 0adbb1556e
commit 7e96bb3d80
6 changed files with 31 additions and 31 deletions

View file

@ -36,12 +36,12 @@ pub async fn page(req: HttpRequest) -> HttpResponse {
};
match fetch_posts(&path, String::new()).await {
Ok(items) => {
Ok((posts,after)) => {
let s = SubredditTemplate {
sub: sub_result,
posts: items.0,
posts: posts,
sort: (sort, param(&path, "t")),
ends: (param(&path, "after"), items.1),
ends: (param(&path, "after"), after),
layout: cookie(req, "layout"),
}
.render()