@@ -626,7 +626,9 @@ pub async fn main() -> Result<utils::ExitCode> {
626
626
ToolchainSubcmd :: List { verbose } => {
627
627
handle_epipe ( common:: list_toolchains ( cfg, verbose) )
628
628
}
629
- ToolchainSubcmd :: Link { toolchain, path } => toolchain_link ( cfg, & toolchain, & path) ,
629
+ ToolchainSubcmd :: Link { toolchain, path } => {
630
+ toolchain_link ( cfg, & toolchain, & path) . await
631
+ }
630
632
ToolchainSubcmd :: Uninstall { opts } => toolchain_remove ( cfg, opts) ,
631
633
} ,
632
634
RustupSubcmd :: Check => check_updates ( cfg) ,
@@ -1245,7 +1247,11 @@ fn component_remove(
1245
1247
Ok ( utils:: ExitCode ( 0 ) )
1246
1248
}
1247
1249
1248
- fn toolchain_link ( cfg : & Cfg , dest : & CustomToolchainName , src : & Path ) -> Result < utils:: ExitCode > {
1250
+ async fn toolchain_link (
1251
+ cfg : & Cfg ,
1252
+ dest : & CustomToolchainName ,
1253
+ src : & Path ,
1254
+ ) -> Result < utils:: ExitCode > {
1249
1255
cfg. ensure_toolchains_dir ( ) ?;
1250
1256
let mut pathbuf = PathBuf :: from ( src) ;
1251
1257
@@ -1258,16 +1264,15 @@ fn toolchain_link(cfg: &Cfg, dest: &CustomToolchainName, src: &Path) -> Result<u
1258
1264
utils:: assert_is_file ( & pathbuf) ?;
1259
1265
1260
1266
if true {
1261
- utils:: run_future (
1262
- InstallMethod :: Link {
1263
- src : & utils:: to_absolute ( src) ?,
1264
- dest,
1265
- cfg,
1266
- }
1267
- . install ( ) ,
1268
- ) ?;
1267
+ InstallMethod :: Link {
1268
+ src : & utils:: to_absolute ( src) ?,
1269
+ dest,
1270
+ cfg,
1271
+ }
1272
+ . install ( )
1273
+ . await ?;
1269
1274
} else {
1270
- utils :: run_future ( InstallMethod :: Copy { src, dest, cfg } . install ( ) ) ?;
1275
+ InstallMethod :: Copy { src, dest, cfg } . install ( ) . await ?;
1271
1276
}
1272
1277
1273
1278
Ok ( utils:: ExitCode ( 0 ) )
0 commit comments