mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 07:37:30 +00:00
Improve compile time a tiny bit
This commit is contained in:
parent
4271e4c703
commit
c7a079d32d
4 changed files with 13 additions and 10 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue