diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-16 18:49:08 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-16 18:49:08 +0100 |
commit | 89aad020c841111b931644e057cd64dcd3d55aca (patch) | |
tree | b6aa7061eb779ab1077713d1efe71601e7115c61 /xtask/src/codegen.rs | |
parent | 4271e4c703d8d764a1d6ffdc501a6cea2157f9d1 (diff) | |
parent | c7a079d32d33684d70b8a920eeaa10fc1d0a1fc5 (diff) |
Merge #6255
6255: Improve compile time a tiny bit r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'xtask/src/codegen.rs')
-rw-r--r-- | xtask/src/codegen.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xtask/src/codegen.rs b/xtask/src/codegen.rs index 45b17bb48..1e7894617 100644 --- a/xtask/src/codegen.rs +++ b/xtask/src/codegen.rs | |||
@@ -77,12 +77,12 @@ fn update(path: &Path, contents: &str, mode: Mode) -> Result<()> { | |||
77 | 77 | ||
78 | const PREAMBLE: &str = "Generated file, do not edit by hand, see `xtask/src/codegen`"; | 78 | const PREAMBLE: &str = "Generated file, do not edit by hand, see `xtask/src/codegen`"; |
79 | 79 | ||
80 | fn reformat(text: impl std::fmt::Display) -> Result<String> { | 80 | fn reformat(text: &str) -> Result<String> { |
81 | let _e = pushenv("RUSTUP_TOOLCHAIN", "stable"); | 81 | let _e = pushenv("RUSTUP_TOOLCHAIN", "stable"); |
82 | ensure_rustfmt()?; | 82 | ensure_rustfmt()?; |
83 | let stdout = run!( | 83 | let stdout = run!( |
84 | "rustfmt --config-path {} --config fn_single_line=true", project_root().join("rustfmt.toml").display(); | 84 | "rustfmt --config-path {} --config fn_single_line=true", project_root().join("rustfmt.toml").display(); |
85 | <text.to_string().as_bytes() | 85 | <text.as_bytes() |
86 | )?; | 86 | )?; |
87 | Ok(format!("//! {}\n\n{}\n", PREAMBLE, stdout)) | 87 | Ok(format!("//! {}\n\n{}\n", PREAMBLE, stdout)) |
88 | } | 88 | } |