@@ -137,13 +137,13 @@ fn cargo_fmt(context: &FmtContext, path: &Path) -> Result<bool, CliError> {
137137 args. push ( "--" ) ;
138138 args. push ( "--check" ) ;
139139 }
140- let success = exec ( context, & bin_path ( "cargo" ) , path, & args) ?;
140+ let success = exec ( context, "cargo" , path, & args) ?;
141141
142142 Ok ( success)
143143}
144144
145145fn rustfmt_test ( context : & FmtContext ) -> Result < ( ) , CliError > {
146- let program = bin_path ( "rustfmt" ) ;
146+ let program = "rustfmt" ;
147147 let dir = std:: env:: current_dir ( ) ?;
148148 let args = & [ "+nightly" , "--version" ] ;
149149
@@ -170,7 +170,7 @@ fn rustfmt(context: &FmtContext, path: &Path) -> Result<bool, CliError> {
170170 if context. check {
171171 args. push ( "--check" . as_ref ( ) ) ;
172172 }
173- let success = exec ( context, & bin_path ( "rustfmt" ) , std:: env:: current_dir ( ) ?, & args) ?;
173+ let success = exec ( context, "rustfmt" , std:: env:: current_dir ( ) ?, & args) ?;
174174 if !success {
175175 eprintln ! ( "rustfmt failed on {}" , path. display( ) ) ;
176176 }
@@ -195,12 +195,3 @@ fn project_root() -> Result<PathBuf, CliError> {
195195
196196 Err ( CliError :: ProjectRootNotFound )
197197}
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