18 lines
580 B
Rust
18 lines
580 B
Rust
use crate::utils::{FileUpdater, update_text_region_fn};
|
|
use chrono::offset::Utc;
|
|
use std::fmt::Write;
|
|
|
|
pub fn update_nightly() {
|
|
let date = Utc::now().format("%Y-%m-%d").to_string();
|
|
let update = &mut update_text_region_fn(
|
|
"# begin autogenerated nightly\n",
|
|
"# end autogenerated nightly",
|
|
|dst| {
|
|
writeln!(dst, "channel = \"nightly-{date}\"").unwrap();
|
|
},
|
|
);
|
|
|
|
let mut updater = FileUpdater::default();
|
|
updater.update_file("rust-toolchain.toml", update);
|
|
updater.update_file("clippy_utils/README.md", update);
|
|
}
|