Skip to content

Commit 5b1a8d3

Browse files
Bump dependencies
1 parent b219427 commit 5b1a8d3

File tree

9 files changed

+887
-769
lines changed

9 files changed

+887
-769
lines changed

Cargo.lock

Lines changed: 838 additions & 730 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ opt-level = 0
1616
base64 = "0.13.0"
1717
bytes = "0.4.9"
1818
chrono = { version = "0.4", features = ["serde"] }
19-
crates-index = "0.16.2"
19+
crates-index = "0.18"
2020
crossbeam-utils = "0.8"
2121
crossbeam-channel = "0.5"
2222
csv = "1.0.2"
2323
docsrs-metadata = { git = "https://github.com/rust-lang/docs.rs/" }
24-
dotenv = "0.13"
24+
dotenv = "0.15"
2525
failure = "0.1.3"
2626
flate2 = "1"
2727
http = "0.1.10"
@@ -30,9 +30,9 @@ lazy_static = "1.0"
3030
mime = "0.3.1"
3131
minifier = { version = "0.0.20", features = ["html"] }
3232
r2d2 = "0.8.2"
33-
r2d2_sqlite = "0.20.0"
34-
rusqlite = { version = "0.27.0", features = ["chrono", "functions", "bundled"] }
35-
rand = "0.5"
33+
r2d2_sqlite = "0.21.0"
34+
rusqlite = { version = "0.28.0", features = ["chrono", "functions", "bundled"] }
35+
rand = "0.8"
3636
regex = "1.0"
3737
reqwest = { version = "0.11", features = ["blocking", "json"] }
3838
serde = "1.0"
@@ -45,29 +45,29 @@ tar = "0.4.36"
4545
tempfile = "3.0.0"
4646
tera = "0.11.7"
4747
toml = "0.4.6"
48-
url = "1.1"
48+
url = "2"
4949
walkdir = "2"
5050
warp = "0.1.9"
5151
log = "0.4.6"
52-
env_logger = "0.6.0"
53-
hmac = "0.7"
54-
sha-1 = "0.8"
52+
env_logger = "0.9.0"
53+
hmac = "0.12"
54+
sha-1 = "0.10"
5555
rust_team_data = { git = "https://github.com/rust-lang/team" }
5656
systemstat = "0.1.11"
5757
rustwide = { version = "0.14.0", features = ["unstable", "unstable-toolchain-ci"] }
5858
percent-encoding = "2.1.0"
59-
remove_dir_all = "0.5.2"
59+
remove_dir_all = "0.7"
6060
ctrlc = "3.1.3"
6161
prometheus = "0.7.0"
6262
cargo_metadata = "0.12.1"
6363
indexmap = "1.4.0"
6464
tokio = "1.18"
65-
aws-types = { version = "0.12", features = ["hardcoded-credentials"] }
66-
aws-smithy-http = "0.42"
67-
aws-sdk-s3 = "0.12"
65+
aws-types = { version = "0.46", features = ["hardcoded-credentials"] }
66+
aws-smithy-http = "0.46"
67+
aws-sdk-s3 = "0.16"
6868

6969
[dev-dependencies]
70-
assert_cmd = "1.0.2"
70+
assert_cmd = "2.0.4"
7171
difference = "2.0.0"
7272
num_cpus = "1.8.0"
7373
predicates = "1.0.0"

src/crates/lists.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::db::{Database, QueryUtils};
55
use crate::experiments::CrateSelect;
66
use crate::prelude::*;
77
use chrono::Utc;
8-
use rand::{thread_rng, Rng};
8+
use rand::{seq::SliceRandom, thread_rng};
99
use std::collections::HashSet;
1010

1111
pub(crate) use crate::crates::sources::{
@@ -141,7 +141,7 @@ pub(crate) fn get_crates(
141141
crates.append(&mut GitHubList::get(db)?);
142142

143143
let mut rng = thread_rng();
144-
rng.shuffle(&mut crates);
144+
crates.shuffle(&mut rng);
145145
crates.truncate(*n as usize);
146146
}
147147
CrateSelect::Top(n) => {

src/crates/sources/registry.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ impl List for RegistryList {
1515
let mut counts = HashMap::new();
1616

1717
fs::create_dir_all(&*WORK_DIR)?;
18-
let index = Index::new(WORK_DIR.join("crates.io-index"));
19-
index.retrieve_or_update().to_failure()?;
18+
let mut index = Index::with_path(
19+
WORK_DIR.join("crates.io-index"),
20+
"https://github.com/rust-lang/crates.io-index",
21+
)
22+
.to_failure()?;
23+
index.update().to_failure()?;
2024

2125
for krate in index.crates() {
2226
// The versions() method returns the list of published versions starting from the

src/db/migrations.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
use crate::prelude::*;
2-
use rand::{self, distributions::Alphanumeric, Rng};
2+
use rand::{
3+
self,
4+
distributions::{Alphanumeric, DistString},
5+
};
36
use rusqlite::{Connection, Transaction};
47
use std::collections::HashSet;
58

@@ -137,10 +140,7 @@ fn migrations() -> Vec<(&'static str, MigrationKind)> {
137140

138141
let fn_name = format!(
139142
"crater_migration__{}",
140-
rand::thread_rng()
141-
.sample_iter(&Alphanumeric)
142-
.take(10)
143-
.collect::<String>()
143+
Alphanumeric.sample_string(&mut rand::thread_rng(), 10)
144144
);
145145
t.create_scalar_function(
146146
&fn_name,
@@ -332,10 +332,7 @@ fn migrations() -> Vec<(&'static str, MigrationKind)> {
332332

333333
let fn_name = format!(
334334
"crater_migration__{}",
335-
rand::thread_rng()
336-
.sample_iter(&Alphanumeric)
337-
.take(10)
338-
.collect::<String>()
335+
Alphanumeric.sample_string(&mut rand::thread_rng(), 10)
339336
);
340337
t.create_scalar_function(
341338
&fn_name,

src/report/mod.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ pub fn generate_report<DB: ReadResults>(
217217
crates: &[Crate],
218218
) -> Fallible<RawTestResults> {
219219
let mut crates = crates.to_vec();
220-
let index = Index::new(WORK_DIR.join("crates.io-index"));
220+
let index = Index::with_path(
221+
WORK_DIR.join("crates.io-index"),
222+
"https://github.com/rust-lang/crates.io-index",
223+
)
224+
.to_failure()?;
221225
//crate ids are unique so unstable sort is equivalent to stable sort but is generally faster
222226
crates.sort_unstable_by_key(|a| a.id());
223227
let res = crates
@@ -694,8 +698,12 @@ mod tests {
694698
};
695699
let gh = Crate::GitHub(repo);
696700

697-
let index = Index::new(WORK_DIR.join("crates.io-index"));
698-
index.retrieve_or_update().unwrap();
701+
let mut index = Index::with_path(
702+
WORK_DIR.join("crates.io-index"),
703+
"https://github.com/rust-lang/crates.io-index",
704+
)
705+
.unwrap();
706+
index.update().unwrap();
699707

700708
assert_eq!(
701709
get_crate_version_status(&index, &reg).unwrap().unwrap(),

src/report/s3.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ impl FromStr for S3Prefix {
4646

4747
Ok(S3Prefix {
4848
bucket,
49-
prefix: parsed.path()[1..].into(),
49+
prefix: parsed
50+
.path()
51+
.get(1..)
52+
.map(PathBuf::from)
53+
.unwrap_or_default(),
5054
})
5155
}
5256
}

src/server/routes/webhooks/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ fn verify_signature(secret: &str, payload: &[u8], raw_signature: &str) -> bool {
185185
}
186186

187187
// Verify the HMAC signature
188-
let mut mac = HmacSha1::new_varkey(secret.as_bytes()).unwrap();
189-
mac.input(payload);
190-
mac.verify(&signature).is_ok()
188+
let mut mac = HmacSha1::new_from_slice(secret.as_bytes()).unwrap();
189+
mac.update(payload);
190+
mac.verify_slice(&signature).is_ok()
191191
}
192192

193193
fn receive_endpoint(

tests/minicrater/driver.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::common::CommandCraterExt;
22
use assert_cmd::prelude::*;
33
use difference::Changeset;
4-
use rand::{self, distributions::Alphanumeric, Rng};
4+
use rand::distributions::{Alphanumeric, DistString};
55
use serde_json::{self, Value};
66
use std::env;
77
use std::path::{Path, PathBuf};
@@ -148,10 +148,7 @@ impl MinicraterRun {
148148
let ex_arg = format!(
149149
"--ex=minicrater-{}-{}",
150150
self.ex,
151-
rand::thread_rng()
152-
.sample_iter(&Alphanumeric)
153-
.take(10)
154-
.collect::<String>()
151+
Alphanumeric.sample_string(&mut rand::thread_rng(), 10)
155152
);
156153

157154
// Create local list in the temp work dir

0 commit comments

Comments
 (0)