Replace as_ref().map() with as_deref()

This commit is contained in:
Kitaiti Makoto 2021-01-15 23:21:33 +09:00
parent 0775c8f3f9
commit dfe83aafc5
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ pub fn search(query: Option<Form<SearchQuery>>, rockets: PlumeRocket) -> Ructe {
let query = query.map(Form::into_inner).unwrap_or_default();
let page = query.page.unwrap_or_default();
let mut parsed_query =
Query::from_str(&query.q.as_ref().map(String::as_str).unwrap_or_default())
Query::from_str(&query.q.as_deref().unwrap_or_default())
.unwrap_or_default();
param_to_query!(query, parsed_query; normal: title, subtitle, content, tag,

View File

@ -42,7 +42,7 @@
}
</main>
@for res in &comment_tree.responses {
@:comment_html(ctx, res, comm.ap_url.as_ref().map(|u| &**u), blog, slug)
@:comment_html(ctx, res, comm.ap_url.as_deref(), blog, slug)
}
</div>
}}