diff --git a/src/web/metrics.rs b/src/web/metrics.rs index 28733e289..fc3d677da 100644 --- a/src/web/metrics.rs +++ b/src/web/metrics.rs @@ -13,7 +13,7 @@ pub(super) fn metrics_handler(req: &mut Request) -> IronResult { let queue = extension!(req, BuildQueue); let mut buffer = Vec::new(); - let families = ctry!(req, metrics.gather(pool, &*queue)); + let families = ctry!(req, metrics.gather(pool, queue)); ctry!(req, TextEncoder::new().encode(&families, &mut buffer)); let mut resp = Response::with(buffer); diff --git a/src/web/routes.rs b/src/web/routes.rs index 2f0e77aa5..5c666f8e8 100644 --- a/src/web/routes.rs +++ b/src/web/routes.rs @@ -354,7 +354,7 @@ impl BlockBlacklistedPrefixes { impl Handler for BlockBlacklistedPrefixes { fn handle(&self, req: &mut iron::Request) -> iron::IronResult { - if let Some(prefix) = req.url.path().get(0) { + if let Some(prefix) = req.url.path().first() { if self.blacklist.contains(*prefix) { return Err(super::error::Nope::CrateNotFound.into()); } diff --git a/src/web/rustdoc.rs b/src/web/rustdoc.rs index bf5e23e2a..00a4d3dfd 100644 --- a/src/web/rustdoc.rs +++ b/src/web/rustdoc.rs @@ -358,7 +358,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult { // if visiting the full path to the default target, remove the target from the path // expects a req_path that looks like `[/:target]/.*` - if req_path.get(0).copied() == Some(&krate.metadata.default_target) { + if req_path.first().copied() == Some(&krate.metadata.default_target) { return redirect(&name, &version_or_latest, &req_path[1..]); } @@ -395,7 +395,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult { storage.rustdoc_file_exists(&name, &version, &path, krate.archive_storage) ) { redirect(&name, &version_or_latest, &req_path) - } else if req_path.get(0).map_or(false, |p| p.contains('-')) { + } else if req_path.first().map_or(false, |p| p.contains('-')) { // This is a target, not a module; it may not have been built. // Redirect to the default target and show a search page instead of a hard 404. redirect( @@ -534,7 +534,7 @@ fn path_for_version(file_path: &[&str], crate_details: &CrateDetails) -> String }; let is_source_view = if platform.is_empty() { // /{name}/{version}/src/{crate}/index.html - file_path.get(0).copied() == Some("src") + file_path.first().copied() == Some("src") } else { // /{name}/{version}/{platform}/src/{crate}/index.html file_path.get(1).copied() == Some("src")