We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
RUSTFMT
rustfmt
1 parent 61555ff commit ea56e2eCopy full SHA for ea56e2e
tonic-build/src/lib.rs
@@ -165,13 +165,14 @@ pub fn fmt(out_dir: &str) {
165
if !file.ends_with(".rs") {
166
continue;
167
}
168
- let result = Command::new("rustfmt")
169
- .arg("--emit")
170
- .arg("files")
171
- .arg("--edition")
172
- .arg("2018")
173
- .arg(format!("{}/{}", out_dir, file))
174
- .output();
+ let result =
+ Command::new(std::env::var("RUSTFMT").unwrap_or_else(|_| "rustfmt".to_owned()))
+ .arg("--emit")
+ .arg("files")
+ .arg("--edition")
+ .arg("2018")
+ .arg(format!("{}/{}", out_dir, file))
175
+ .output();
176
177
match result {
178
Err(e) => {
0 commit comments