File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -447,7 +447,7 @@ impl<'a> Toolchain<'a> {
447
447
LocalToolchainName :: Named ( t) => t,
448
448
LocalToolchainName :: Path ( _) => bail ! ( "Cannot remove a path based toolchain" ) ,
449
449
} ;
450
- match Self :: exists ( cfg, & ( & name) . into ( ) ) ? {
450
+ let fs_modified = match Self :: exists ( cfg, & ( & name) . into ( ) ) ? {
451
451
true => {
452
452
( cfg. notify_handler ) ( Notification :: UninstallingToolchain ( & name) ) ;
453
453
let installed_paths = match & name {
@@ -466,19 +466,22 @@ impl<'a> Toolchain<'a> {
466
466
}
467
467
}
468
468
}
469
+ true
469
470
}
470
471
false => {
471
472
// Might be a dangling symlink
472
473
if path. is_symlink ( ) {
473
474
( cfg. notify_handler ) ( Notification :: UninstallingToolchain ( & name) ) ;
474
475
fs:: remove_dir_all ( & path) ?;
476
+ true
475
477
} else {
476
478
info ! ( "no toolchain installed for '{name}'" ) ;
479
+ false
477
480
}
478
481
}
479
- }
482
+ } ;
480
483
481
- if !path. is_symlink ( ) && !path. exists ( ) {
484
+ if !path. is_symlink ( ) && !path. exists ( ) && fs_modified {
482
485
( cfg. notify_handler ) ( Notification :: UninstalledToolchain ( & name) ) ;
483
486
}
484
487
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments