Skip to content

Commit d1fc876

Browse files
committed
Use commit url rather than parsing toml
1 parent d8db1ef commit d1fc876

File tree

3 files changed

+3
-34
lines changed

3 files changed

+3
-34
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ structopt = "0.2.5"
2626
tar = "0.4"
2727
tee = "0.1"
2828
tempdir = "0.3.6"
29-
toml = "0.4"
3029
xz2 = "0.1.3"
3130
chrono = "0.4.0"
3231

src/main.rs

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ extern crate structopt;
2525
extern crate tar;
2626
extern crate tee;
2727
extern crate tempdir;
28-
extern crate toml;
2928
extern crate xz2;
3029

3130
use std::env;
@@ -50,7 +49,6 @@ use structopt::StructOpt;
5049
use tar::Archive;
5150
use tee::TeeReader;
5251
use tempdir::TempDir;
53-
use toml::Value;
5452
use xz2::read::XzDecoder;
5553

5654
/// The first commit which build artifacts are made available through the CI for
@@ -197,33 +195,15 @@ impl Bound {
197195
Bound::Commit(commit) => Ok(Bound::Commit(commit)),
198196
Bound::Date(date) => {
199197
let date_str = date.format("%Y-%m-%d");
200-
let url = format!("{}/{}/channel-rust-nightly.toml", NIGHTLY_SERVER, date_str);
198+
let url = format!("{}/{}/channel-rust-nightly-git-commit-hash.txt", NIGHTLY_SERVER, date_str);
201199

202200
eprintln!("fetching {}", url);
203201
let client = Client::new();
204202
let name = format!("nightly manifest {}", date_str);
205203
let (response, mut bar) = download_progress(&client, &name, &url)?;
206204
let mut response = TeeReader::new(response, &mut bar);
207-
let mut toml_buf = String::new();
208-
response.read_to_string(&mut toml_buf)?;
209-
210-
let manifest = toml_buf.parse::<Value>().unwrap();
211-
212-
let commit = match manifest {
213-
Value::Table(t) => match t.get("pkg") {
214-
Some(&Value::Table(ref t)) => match t.get("rust") {
215-
Some(&Value::Table(ref t)) => match t.get("git_commit_hash") {
216-
Some(&Value::String(ref hash)) => hash.to_owned(),
217-
_ => bail!(
218-
"not a rustup manifest (no valid git_commit_hash key under rust"
219-
),
220-
},
221-
_ => bail!("not a rustup manifest (no rust key under pkg)"),
222-
},
223-
_ => bail!("not a rustup manifest (missing pkg key)"),
224-
},
225-
_ => bail!("not a rustup manifest (not a table at root)"),
226-
};
205+
let mut commit = String::new();
206+
response.read_to_string(&mut commit)?;
227207

228208
eprintln!("converted {} to {}", date_str, commit);
229209

0 commit comments

Comments
 (0)