Skip to content

Commit 19b354a

Browse files
Nemo157jyn514
authored andcommitted
Fix some nightly clippy warnings
1 parent c12b5a9 commit 19b354a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/web/metrics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(super) fn metrics_handler(req: &mut Request) -> IronResult<Response> {
1313
let queue = extension!(req, BuildQueue);
1414

1515
let mut buffer = Vec::new();
16-
let families = ctry!(req, metrics.gather(pool, &*queue));
16+
let families = ctry!(req, metrics.gather(pool, queue));
1717
ctry!(req, TextEncoder::new().encode(&families, &mut buffer));
1818

1919
let mut resp = Response::with(buffer);

src/web/routes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ impl BlockBlacklistedPrefixes {
354354

355355
impl Handler for BlockBlacklistedPrefixes {
356356
fn handle(&self, req: &mut iron::Request) -> iron::IronResult<iron::Response> {
357-
if let Some(prefix) = req.url.path().get(0) {
357+
if let Some(prefix) = req.url.path().first() {
358358
if self.blacklist.contains(*prefix) {
359359
return Err(super::error::Nope::CrateNotFound.into());
360360
}

src/web/rustdoc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
363363

364364
// if visiting the full path to the default target, remove the target from the path
365365
// 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) {
367367
return redirect(&name, &version_or_latest, &req_path[1..]);
368368
}
369369

@@ -400,7 +400,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
400400
storage.rustdoc_file_exists(&name, &version, &path, krate.archive_storage)
401401
) {
402402
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('-')) {
404404
// This is a target, not a module; it may not have been built.
405405
// Redirect to the default target and show a search page instead of a hard 404.
406406
redirect(
@@ -539,7 +539,7 @@ fn path_for_version(file_path: &[&str], crate_details: &CrateDetails) -> String
539539
};
540540
let is_source_view = if platform.is_empty() {
541541
// /{name}/{version}/src/{crate}/index.html
542-
file_path.get(0).copied() == Some("src")
542+
file_path.first().copied() == Some("src")
543543
} else {
544544
// /{name}/{version}/{platform}/src/{crate}/index.html
545545
file_path.get(1).copied() == Some("src")

0 commit comments

Comments
 (0)