Skip to content

Commit b6dafd2

Browse files
committed
Use channel-rust-nightly-date.txt instead of channel-rust-nightly.toml
This uses the text file to get the nightly date, which is faster and easier, and doesn't require toml parsing.
1 parent 0ec0fb3 commit b6dafd2

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

Diff for: Cargo.lock

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

Diff for: Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ xz2 = "0.1.7"
3333
chrono = "0.4.22"
3434
colored = "2"
3535
regex = "1.10.1"
36-
toml = "0.8.10"
3736

3837
[dev-dependencies]
3938
quickcheck = "1"

Diff for: src/bounds.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,13 @@ fn installed_nightly_or_latest() -> anyhow::Result<GitDate> {
212212

213213
/// Returns the date of the latest nightly (fetched from the network).
214214
fn find_latest_nightly() -> anyhow::Result<GitDate> {
215-
let url = format!("{NIGHTLY_SERVER}/channel-rust-nightly.toml");
215+
let url = format!("{NIGHTLY_SERVER}/channel-rust-nightly-date.txt");
216216
eprintln!("fetching {url}");
217217
let client = Client::new();
218-
let mut response = download_progress(&client, "nightly manifest", &url)?;
219-
let mut manifest = String::new();
220-
response.read_to_string(&mut manifest)?;
221-
let manifest: toml::Value = toml::from_str(&manifest)?;
222-
let date = manifest["date"].as_str().expect("date is a string");
223-
let date = NaiveDate::parse_from_str(date, "%Y-%m-%d")?;
218+
let mut response = download_progress(&client, "nightly date", &url)?;
219+
let mut body = String::new();
220+
response.read_to_string(&mut body)?;
221+
let date = NaiveDate::parse_from_str(&body, "%Y-%m-%d")?;
224222
eprintln!("determined the latest nightly is {date}");
225223
Ok(date)
226224
}

0 commit comments

Comments
 (0)