aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/codegen.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-10-16 18:47:47 +0100
committerAleksey Kladov <[email protected]>2020-10-16 18:47:47 +0100
commitc7a079d32d33684d70b8a920eeaa10fc1d0a1fc5 (patch)
treeb6aa7061eb779ab1077713d1efe71601e7115c61 /xtask/src/codegen.rs
parent4271e4c703d8d764a1d6ffdc501a6cea2157f9d1 (diff)
Improve compile time a tiny bit
Diffstat (limited to 'xtask/src/codegen.rs')
-rw-r--r--xtask/src/codegen.rs4
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
78const PREAMBLE: &str = "Generated file, do not edit by hand, see `xtask/src/codegen`"; 78const PREAMBLE: &str = "Generated file, do not edit by hand, see `xtask/src/codegen`";
79 79
80fn reformat(text: impl std::fmt::Display) -> Result<String> { 80fn 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}