Skip to content

Commit 8a49393

Browse files
rbtcollinsdjc
authored andcommitted
Make InstallMethod::run async
1 parent 21c0737 commit 8a49393

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/install.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ impl<'a> InstallMethod<'a> {
7272
}
7373

7474
(self.cfg().notify_handler)(RootNotification::ToolchainDirectory(&self.dest_path()));
75-
let updated = self.run(&self.dest_path(), &|n| {
75+
let updated = utils::run_future(self.run(&self.dest_path(), &|n| {
7676
(self.cfg().notify_handler)(n.into())
77-
})?;
77+
}))?;
7878

7979
let status = match updated {
8080
false => {
@@ -102,7 +102,7 @@ impl<'a> InstallMethod<'a> {
102102
}
103103
}
104104

105-
fn run(&self, path: &Path, notify_handler: &dyn Fn(Notification<'_>)) -> Result<bool> {
105+
async fn run(&self, path: &Path, notify_handler: &dyn Fn(Notification<'_>)) -> Result<bool> {
106106
if path.exists() {
107107
// Don't uninstall first for Dist method
108108
match self {
@@ -136,7 +136,7 @@ impl<'a> InstallMethod<'a> {
136136
..
137137
} => {
138138
let prefix = &InstallPrefix::from(path.to_owned());
139-
let maybe_new_hash = utils::run_future(dist::update_from_dist(
139+
let maybe_new_hash = dist::update_from_dist(
140140
*dl_cfg,
141141
update_hash.as_deref(),
142142
desc,
@@ -147,7 +147,8 @@ impl<'a> InstallMethod<'a> {
147147
old_date_version.as_ref().map(|dv| dv.0.as_str()),
148148
components,
149149
targets,
150-
))?;
150+
)
151+
.await?;
151152

152153
if let Some(hash) = maybe_new_hash {
153154
if let Some(hash_file) = update_hash {

0 commit comments

Comments
 (0)