Improve compile time a tiny bit

This commit is contained in:
Aleksey Kladov 2020-10-16 19:47:47 +02:00
parent 4271e4c703
commit c7a079d32d
4 changed files with 13 additions and 10 deletions

View file

@ -77,12 +77,12 @@ fn update(path: &Path, contents: &str, mode: Mode) -> Result<()> {
const PREAMBLE: &str = "Generated file, do not edit by hand, see `xtask/src/codegen`";
fn reformat(text: impl std::fmt::Display) -> Result<String> {
fn reformat(text: &str) -> Result<String> {
let _e = pushenv("RUSTUP_TOOLCHAIN", "stable");
ensure_rustfmt()?;
let stdout = run!(
"rustfmt --config-path {} --config fn_single_line=true", project_root().join("rustfmt.toml").display();
<text.to_string().as_bytes()
<text.as_bytes()
)?;
Ok(format!("//! {}\n\n{}\n", PREAMBLE, stdout))
}