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

@ -29,12 +29,12 @@ pub async fn profile(req: HttpRequest) -> HttpResponse {
let posts = fetch_posts(&path, "Comment".to_string()).await;
match posts {
Ok(items) => {
Ok((posts, after)) => {
let s = UserTemplate {
user: user.unwrap(),
posts: items.0,
posts,
sort: (sort, param(&path, "t")),
ends: (param(&path, "after"), items.1),
ends: (param(&path, "after"), after),
layout: cookie(req, "layout"),
}
.render()