aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src/lib.rs')
-rw-r--r--xtask/src/lib.rs11
1 files changed, 0 insertions, 11 deletions
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs
index 807ef587c..f3ad81ba7 100644
--- a/xtask/src/lib.rs
+++ b/xtask/src/lib.rs
@@ -62,17 +62,6 @@ pub fn run_rustfmt(mode: Mode) -> Result<()> {
62 Ok(()) 62 Ok(())
63} 63}
64 64
65fn reformat(text: impl std::fmt::Display) -> Result<String> {
66 let _e = pushenv("RUSTUP_TOOLCHAIN", "stable");
67 ensure_rustfmt()?;
68 let stdout = run!(
69 "rustfmt --config-path {} --config fn_single_line=true", project_root().join("rustfmt.toml").display();
70 <text.to_string().as_bytes()
71 )?;
72 let preamble = "Generated file, do not edit by hand, see `xtask/src/codegen`";
73 Ok(format!("//! {}\n\n{}\n", preamble, stdout))
74}
75
76fn ensure_rustfmt() -> Result<()> { 65fn ensure_rustfmt() -> Result<()> {
77 let out = run!("rustfmt --version")?; 66 let out = run!("rustfmt --version")?;
78 if !out.contains("stable") { 67 if !out.contains("stable") {