mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-24 18:10:58 +00:00
Optimize use of Result<>
This commit is contained in:
parent
0adbb1556e
commit
7e96bb3d80
6 changed files with 31 additions and 31 deletions
|
@ -33,16 +33,16 @@ pub async fn find(req: HttpRequest) -> HttpResponse {
|
|||
let sub = req.match_info().get("sub").unwrap_or("").to_string();
|
||||
|
||||
match fetch_posts(&path, String::new()).await {
|
||||
Ok(posts) => HttpResponse::Ok().content_type("text/html").body(
|
||||
Ok((posts, after)) => HttpResponse::Ok().content_type("text/html").body(
|
||||
SearchTemplate {
|
||||
posts: posts.0,
|
||||
posts,
|
||||
sub,
|
||||
params: SearchParams {
|
||||
q: param(&path, "q"),
|
||||
sort,
|
||||
t: param(&path, "t"),
|
||||
before: param(&path, "after"),
|
||||
after: posts.1,
|
||||
after,
|
||||
restrict_sr: param(&path, "restrict_sr"),
|
||||
},
|
||||
layout: cookie(req, "layout"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue