Skip to content

Commit 051fbb1

Browse files
rbtcollinsdjc
authored andcommitted
Make update_from_dist_ async
1 parent eb30f91 commit 051fbb1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/dist/dist.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ pub(crate) fn update_from_dist(
724724
std::fs::remove_file(update_hash.unwrap())?;
725725
}
726726

727-
let res = update_from_dist_(
727+
let res = utils::run_future(update_from_dist_(
728728
download,
729729
update_hash,
730730
toolchain,
@@ -735,7 +735,7 @@ pub(crate) fn update_from_dist(
735735
old_date,
736736
components,
737737
targets,
738-
);
738+
));
739739

740740
// Don't leave behind an empty / broken installation directory
741741
if res.is_err() && fresh_install {
@@ -746,7 +746,7 @@ pub(crate) fn update_from_dist(
746746
res
747747
}
748748

749-
fn update_from_dist_(
749+
async fn update_from_dist_(
750750
download: DownloadCfg<'_>,
751751
update_hash: Option<&Path>,
752752
toolchain: &ToolchainDesc,
@@ -802,7 +802,7 @@ fn update_from_dist_(
802802
};
803803

804804
loop {
805-
match utils::run_future(try_update_from_dist_(
805+
match try_update_from_dist_(
806806
download,
807807
update_hash,
808808
&toolchain,
@@ -812,7 +812,9 @@ fn update_from_dist_(
812812
components,
813813
targets,
814814
&mut fetched,
815-
)) {
815+
)
816+
.await
817+
{
816818
Ok(v) => break Ok(v),
817819
Err(e) => {
818820
if !backtrack {

0 commit comments

Comments
 (0)