Skip to content

Commit 34060ae

Browse files
committed
Use tokio::main attribute
1 parent 1a8bae1 commit 34060ae

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

src/bin/rustup-init.rs

+9-15
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use cfg_if::cfg_if;
1919
use rs_tracing::{
2020
close_trace_file, close_trace_file_internal, open_trace_file, trace_to_file_internal,
2121
};
22-
use tokio::runtime::Builder;
2322

2423
use rustup::cli::common;
2524
use rustup::cli::proxy_mode;
@@ -33,24 +32,19 @@ use rustup::errors::RustupError;
3332
use rustup::is_proxyable_tools;
3433
use rustup::utils::utils::{self, ExitCode};
3534

36-
fn main() {
35+
#[tokio::main]
36+
async fn main() {
3737
#[cfg(windows)]
3838
pre_rustup_main_init();
3939

4040
let process = Process::os();
41-
Builder::new_multi_thread()
42-
.enable_all()
43-
.build()
44-
.unwrap()
45-
.block_on(async move {
46-
match maybe_trace_rustup(&process).await {
47-
Err(e) => {
48-
common::report_error(&e, &process);
49-
std::process::exit(1);
50-
}
51-
Ok(utils::ExitCode(c)) => std::process::exit(c),
52-
}
53-
});
41+
match maybe_trace_rustup(&process).await {
42+
Err(e) => {
43+
common::report_error(&e, &process);
44+
std::process::exit(1);
45+
}
46+
Ok(utils::ExitCode(c)) => std::process::exit(c),
47+
}
5448
}
5549

5650
async fn maybe_trace_rustup(process: &Process) -> Result<utils::ExitCode> {

0 commit comments

Comments
 (0)