mirror of
https://github.com/spikecodes/libreddit.git
synced 2026-01-25 22:14:06 +01:00
Optimize use of Result<>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user