Skip to content

Commit 34fd7c6

Browse files
committed
Use manual Tokio runtime setup
1 parent cd1ca41 commit 34fd7c6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/bin/rustup-init.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,24 @@ use rustup::is_proxyable_tools;
3636
use rustup::process::Process;
3737
use rustup::utils;
3838

39-
#[tokio::main]
40-
async fn main() -> Result<ExitCode> {
39+
fn main() -> Result<ExitCode> {
4140
#[cfg(windows)]
4241
pre_rustup_main_init();
4342

43+
let runtime = tokio::runtime::Builder::new_multi_thread()
44+
.enable_all()
45+
.build()
46+
.unwrap();
47+
4448
let process = Process::os();
45-
let result = {
49+
let result = runtime.block_on(async {
4650
#[cfg(feature = "otel")]
4751
let _telemetry_guard = log::set_global_telemetry();
4852
tracing_log::LogTracer::init()?;
4953
let (subscriber, console_filter) = log::tracing_subscriber(&process);
5054
tracing::subscriber::set_global_default(subscriber)?;
5155
run_rustup(&process, console_filter).await
52-
};
56+
});
5357

5458
match result {
5559
Err(e) => {

0 commit comments

Comments
 (0)