Skip to content

Commit f54dceb

Browse files
committed
Switch to let _ = to ignore errors and explain why
1 parent c2763d8 commit f54dceb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/krate.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,12 @@ pub fn download(req: &mut Request) -> CargoResult<Response> {
828828
let crate_name = &req.params()["crate_id"];
829829
let version = &req.params()["version"];
830830

831-
match increment_download_counts(req, crate_name, version) {
832-
_ => {} // do not try, ignore failures
833-
}
831+
// Ignore failure to update download counts. We might be a mirror that
832+
// doesn't have the crates available in the database (so can't look them
833+
// up) and therefore doesn't care about the download counts, but we can
834+
// still construct valid crate URLs. Cargo will verify that the crate and
835+
// version are in the crate index before making a request to this route.
836+
let _ = increment_download_counts(req, crate_name, version);
834837

835838
let redirect_url = format!("https://{}/crates/{}/{}-{}.crate",
836839
req.app().bucket.host(),

0 commit comments

Comments
 (0)