File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -742,12 +742,12 @@ pub(crate) async fn update_from_dist(
742
742
opts : & DistOptions < ' _ > ,
743
743
) -> Result < Option < String > > {
744
744
let fresh_install = !prefix. path ( ) . exists ( ) ;
745
- let hash_exists = opts. update_hash . map ( Path :: exists ) . unwrap_or ( false ) ;
746
- // fresh_install means the toolchain isn't present, but hash_exists means there is a stray hash file
747
- if fresh_install && hash_exists {
748
- // It's ok to unwrap, because hash have to exist at this point
749
- ( opts . dl_cfg . notify_handler ) ( Notification :: StrayHash ( opts . update_hash . unwrap ( ) ) ) ;
750
- std :: fs :: remove_file ( opts . update_hash . unwrap ( ) ) ? ;
745
+ if let Some ( hash ) = opts. update_hash {
746
+ // fresh_install means the toolchain isn't present, but hash_exists means there is a stray hash file
747
+ if fresh_install && Path :: exists ( hash ) {
748
+ ( opts . dl_cfg . notify_handler ) ( Notification :: StrayHash ( hash) ) ;
749
+ std :: fs :: remove_file ( hash ) ? ;
750
+ }
751
751
}
752
752
753
753
let res = update_from_dist_ (
You can’t perform that action at this time.
0 commit comments