@@ -363,7 +363,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
363
363
364
364
// if visiting the full path to the default target, remove the target from the path
365
365
// expects a req_path that looks like `[/:target]/.*`
366
- if req_path. get ( 0 ) . copied ( ) == Some ( & krate. metadata . default_target ) {
366
+ if req_path. first ( ) . copied ( ) == Some ( & krate. metadata . default_target ) {
367
367
return redirect ( & name, & version_or_latest, & req_path[ 1 ..] ) ;
368
368
}
369
369
@@ -400,7 +400,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
400
400
storage. rustdoc_file_exists( & name, & version, & path, krate. archive_storage)
401
401
) {
402
402
redirect ( & name, & version_or_latest, & req_path)
403
- } else if req_path. get ( 0 ) . map_or ( false , |p| p. contains ( '-' ) ) {
403
+ } else if req_path. first ( ) . map_or ( false , |p| p. contains ( '-' ) ) {
404
404
// This is a target, not a module; it may not have been built.
405
405
// Redirect to the default target and show a search page instead of a hard 404.
406
406
redirect (
@@ -539,7 +539,7 @@ fn path_for_version(file_path: &[&str], crate_details: &CrateDetails) -> String
539
539
} ;
540
540
let is_source_view = if platform. is_empty ( ) {
541
541
// /{name}/{version}/src/{crate}/index.html
542
- file_path. get ( 0 ) . copied ( ) == Some ( "src" )
542
+ file_path. first ( ) . copied ( ) == Some ( "src" )
543
543
} else {
544
544
// /{name}/{version}/{platform}/src/{crate}/index.html
545
545
file_path. get ( 1 ) . copied ( ) == Some ( "src" )
0 commit comments