We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67d0cac commit 9328548Copy full SHA for 9328548
src/cargo-fmt/main.rs
@@ -150,9 +150,12 @@ fn execute() -> i32 {
150
}
151
152
fn rustfmt_command() -> Command {
153
- let rustfmt = env::current_exe()
154
- .expect("current executable path invalid")
155
- .with_file_name("rustfmt");
+ let rustfmt = match env::var_os("RUSTFMT") {
+ Some(rustfmt) => PathBuf::from(rustfmt),
+ None => env::current_exe()
156
+ .expect("current executable path invalid")
157
+ .with_file_name("rustfmt"),
158
+ };
159
160
Command::new(rustfmt)
161
0 commit comments