File tree 1 file changed +5
-8
lines changed
1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -329,13 +329,8 @@ impl<'a> Toolchain<'a> {
329
329
pub ( crate ) fn command ( & self , binary : & str ) -> anyhow:: Result < Command > {
330
330
// Should push the cargo fallback into a custom toolchain type? And then
331
331
// perhaps a trait that create command layers on?
332
- if !matches ! (
333
- self . name( ) ,
334
- LocalToolchainName :: Named ( ToolchainName :: Official ( _) )
335
- ) {
336
- if let Some ( cmd) = self . maybe_do_cargo_fallback ( binary) ? {
337
- return Ok ( cmd) ;
338
- }
332
+ if let Some ( cmd) = self . maybe_do_cargo_fallback ( binary) ? {
333
+ return Ok ( cmd) ;
339
334
}
340
335
341
336
self . create_command ( binary)
@@ -344,7 +339,9 @@ impl<'a> Toolchain<'a> {
344
339
// Custom toolchains don't have cargo, so here we detect that situation and
345
340
// try to find a different cargo.
346
341
fn maybe_do_cargo_fallback ( & self , binary : & str ) -> anyhow:: Result < Option < Command > > {
347
- if binary != "cargo" && binary != "cargo.exe" {
342
+ if let LocalToolchainName :: Named ( ToolchainName :: Official ( _) ) = self . name ( ) {
343
+ return Ok ( None ) ;
344
+ } else if binary != "cargo" && binary != "cargo.exe" {
348
345
return Ok ( None ) ;
349
346
}
350
347
You can’t perform that action at this time.
0 commit comments