@@ -137,13 +137,13 @@ fn cargo_fmt(context: &FmtContext, path: &Path) -> Result<bool, CliError> {
137
137
args. push ( "--" ) ;
138
138
args. push ( "--check" ) ;
139
139
}
140
- let success = exec ( context, & bin_path ( "cargo" ) , path, & args) ?;
140
+ let success = exec ( context, "cargo" , path, & args) ?;
141
141
142
142
Ok ( success)
143
143
}
144
144
145
145
fn rustfmt_test ( context : & FmtContext ) -> Result < ( ) , CliError > {
146
- let program = bin_path ( "rustfmt" ) ;
146
+ let program = "rustfmt" ;
147
147
let dir = std:: env:: current_dir ( ) ?;
148
148
let args = & [ "+nightly" , "--version" ] ;
149
149
@@ -170,7 +170,7 @@ fn rustfmt(context: &FmtContext, path: &Path) -> Result<bool, CliError> {
170
170
if context. check {
171
171
args. push ( "--check" . as_ref ( ) ) ;
172
172
}
173
- let success = exec ( context, & bin_path ( "rustfmt" ) , std:: env:: current_dir ( ) ?, & args) ?;
173
+ let success = exec ( context, "rustfmt" , std:: env:: current_dir ( ) ?, & args) ?;
174
174
if !success {
175
175
eprintln ! ( "rustfmt failed on {}" , path. display( ) ) ;
176
176
}
@@ -195,12 +195,3 @@ fn project_root() -> Result<PathBuf, CliError> {
195
195
196
196
Err ( CliError :: ProjectRootNotFound )
197
197
}
198
-
199
- // Workaround for https://github.com/rust-lang/cargo/issues/7475.
200
- // FIXME: replace `&bin_path("command")` with `"command"` once the issue is fixed
201
- fn bin_path ( bin : & str ) -> String {
202
- let mut p = home:: cargo_home ( ) . unwrap ( ) ;
203
- p. push ( "bin" ) ;
204
- p. push ( bin) ;
205
- p. display ( ) . to_string ( )
206
- }
0 commit comments