Skip to content

Commit b2c99c4

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 9d4c32b commit b2c99c4

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

Cargo.lock

Lines changed: 0 additions & 13 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
@@ -37,7 +37,6 @@ xz2 = "0.1.7"
3737
chrono = "0.4.22"
3838
colored = "2"
3939
regex = "1.10.1"
40-
toml = "0.8.10"
4140

4241
[dev-dependencies]
4342
quickcheck = "1"

src/bounds.rs

Lines changed: 5 additions & 7 deletions
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)