Skip to content

Commit 2bbe794

Browse files
Fix clippy lints
1 parent 5c5bedd commit 2bbe794

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/web/rustdoc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ pub(crate) async fn rustdoc_html_server_handler(
366366
// We cannot extract the fragment (`#`) with current `Uri` API so forced to do ugly
367367
// things like that...
368368
uri.path_and_query()
369-
.and_then(|path_and_query| path_and_query.as_str().splitn(2, '?').nth(1))
369+
.and_then(|path_and_query| path_and_query.as_str().split_once('?').map(|s| s.1))
370370
}
371371

372372
// Convenience function to allow for easy redirection
@@ -379,7 +379,7 @@ pub(crate) async fn rustdoc_html_server_handler(
379379
uri: &Uri,
380380
) -> AxumResult<AxumResponse> {
381381
trace!("redirect");
382-
let query = get_query_and_fragment(&uri);
382+
let query = get_query_and_fragment(uri);
383383
Ok(axum_cached_redirect(
384384
EscapedURI::new(&format!("/{}/{}/{}", name, vers, path.join("/")), query).as_str(),
385385
cache_policy,

0 commit comments

Comments
 (0)