File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -280,12 +280,11 @@ fn show_channel_updates(
280
280
281
281
pub ( crate ) async fn update_all_channels (
282
282
cfg : & Cfg < ' _ > ,
283
- do_self_update : bool ,
284
283
force_update : bool ,
285
284
) -> Result < utils:: ExitCode > {
286
285
let toolchains = cfg. update_all_channels ( force_update) . await ?;
287
286
let has_update_error = toolchains. iter ( ) . any ( |( _, r) | r. is_err ( ) ) ;
288
- let mut exit_code = utils:: ExitCode ( if has_update_error { 1 } else { 0 } ) ;
287
+ let exit_code = utils:: ExitCode ( if has_update_error { 1 } else { 0 } ) ;
289
288
290
289
if toolchains. is_empty ( ) {
291
290
info ! ( "no updatable toolchains installed" ) ;
@@ -301,10 +300,6 @@ pub(crate) async fn update_all_channels(
301
300
show_channel_updates ( cfg, t) ?;
302
301
}
303
302
304
- if do_self_update {
305
- exit_code &= self_update ( cfg. process ) . await ?;
306
- }
307
-
308
303
Ok ( exit_code)
309
304
}
310
305
Original file line number Diff line number Diff line change @@ -930,7 +930,11 @@ async fn update(
930
930
info ! ( "the active toolchain `{toolchain}` has been installed" ) ;
931
931
info ! ( "it's active because: {reason}" ) ;
932
932
} else {
933
- exit_code &= common:: update_all_channels ( cfg, self_update, opts. force ) . await ?;
933
+ exit_code &= common:: update_all_channels ( cfg, opts. force ) . await ?;
934
+ if self_update {
935
+ exit_code &= common:: self_update ( cfg. process ) . await ?;
936
+ }
937
+
934
938
info ! ( "cleaning up downloads & tmp directories" ) ;
935
939
utils:: delete_dir_contents_following_links ( & cfg. download_dir ) ;
936
940
cfg. tmp_cx . clean ( ) ;
You can’t perform that action at this time.
0 commit comments