From 7015cd83b9445c4f91a571afb35391c81e6947c5 Mon Sep 17 00:00:00 2001 From: Chase Wilson Date: Tue, 30 Jun 2020 19:16:06 -0500 Subject: [PATCH] Update releases.rs --- Cargo.lock | 6 +++--- Cargo.toml | 7 ++----- src/web/releases.rs | 18 +----------------- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 10479a145..5c3704fae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -382,7 +382,7 @@ dependencies = [ "notify 4.0.15 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "params 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "path-slash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "path-slash 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "postgres 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "procfs 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1936,7 +1936,7 @@ dependencies = [ [[package]] name = "path-slash" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -4241,7 +4241,7 @@ dependencies = [ "checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" "checksum parking_lot_core 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" "checksum parse-zoneinfo 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "feece9d0113b400182a7d00adcff81ccf29158c49c5abd11e2eed8589bf6ff07" -"checksum path-slash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ddf9566c1063a197427135fb518ed42f2be18630fc2401aa267ed2dc95e9c85d" +"checksum path-slash 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ff65715a17cba8979903db6294baef56c5d39e05c8b054cffa31e69e61f24c68" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" "checksum persistent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e8fa0009c4f3d350281309909c618abddf10bb7e3145f28410782f6a5ec74c5" diff --git a/Cargo.toml b/Cargo.toml index 4a247bdab..ee265de4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,11 +43,8 @@ mime_guess = "2" dotenv = "0.15" zstd = "0.5" git2 = { version = "0.13.6", default-features = false } -<<<<<<< HEAD -once_cell = "1.2.0" -======= -path-slash = "0.1.2" ->>>>>>> ddcd932... Added tests for multiple pages, path_slash for Windows and Unix builds and a status to robots.txt +once_cell = "1.4.0" +path-slash = "0.1.3" # Data serialization and deserialization serde = { version = "1.0", features = ["derive"] } diff --git a/src/web/releases.rs b/src/web/releases.rs index db6e07b64..b58da1885 100644 --- a/src/web/releases.rs +++ b/src/web/releases.rs @@ -565,7 +565,7 @@ pub fn search_handler(req: &mut Request) -> IronResult { OFFSET FLOOR(RANDOM() * 280) LIMIT 1", &[] )); - let row = rows.into_iter().next().unwrap(); // TODO: Is this really infallible? + let row = rows.into_iter().next().unwrap(); let name: String = row.get("name"); let version: String = row.get("version"); @@ -1134,22 +1134,6 @@ mod tests { }) } - #[test] - fn recent_queue() { - wrapper(|env| { - let web = env.frontend(); - assert_success("/releases/queue", web)?; - - env.db().fake_release().name("some_random_crate").create()?; - env.db() - .fake_release() - .name("some_random_crate_that_failed") - .build_result_successful(false) - .create()?; - assert_success("/releases/queue", web) - }) - } - #[test] fn release_feed() { wrapper(|env| {