Skip to content

Commit 1fc7195

Browse files
authored
Merge pull request #1856 from rust-lang/fetch-latest-zstd
Update `fetch-latest` to use ZSTD instead of Snappy
2 parents bf37180 + e725837 commit 1fc7195

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

Cargo.lock

+13-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@ database = { path = "../database" }
3838
bytes = "1.0"
3939
url = "2"
4040
analyzeme = { git = "https://github.com/rust-lang/measureme", branch = "stable" }
41-
inferno = { version="0.11", default-features = false }
41+
inferno = { version = "0.11", default-features = false }
4242
mime = "0.3"
4343
prometheus = "0.13"
4444
uuid = { version = "1.3.0", features = ["v4"] }
4545
tera = { version = "1.19", default-features = false }
4646
rust-embed = { version = "6.6.0", features = ["include-exclude", "interpolate-folder-path"] }
4747
humansize = "2"
4848
lru = "0.12.0"
49+
ruzstd = "0.6.0"
4950

5051
[target.'cfg(unix)'.dependencies]
5152
jemallocator = "0.5"

site/src/bin/fetch-latest.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
use anyhow::Context as _;
2-
use snap::read::FrameDecoder;
2+
use ruzstd::StreamingDecoder;
33
use std::io::Write;
44

55
fn main() -> anyhow::Result<()> {
66
let destination = std::env::args()
77
.nth(1)
88
.ok_or(anyhow::anyhow!("destination file should be first argument"))?;
9-
let resp = reqwest::blocking::get("https://perf-data.rust-lang.org/export.db.sz")
9+
let resp = reqwest::blocking::get("https://perf-data.rust-lang.org/export.db.zst")
1010
.context("fetching database")?;
1111
let resp = resp.error_for_status().context("fetching database")?;
12-
let mut decoder = FrameDecoder::new(std::io::BufReader::new(resp));
12+
13+
let mut reader = std::io::BufReader::new(resp);
14+
let mut decoder = StreamingDecoder::new(&mut reader).context("cannot decode")?;
1315
let mut file = std::io::BufWriter::new(
1416
std::fs::File::create(destination).context("creating destination file")?,
1517
);

0 commit comments

Comments
 (0)