From f1b7d649dbfb4fdd0809c4cf5a014442f9abbe1a Mon Sep 17 00:00:00 2001 From: lukas0008 Date: Wed, 7 Aug 2024 20:45:22 +0200 Subject: [PATCH] Reapply "Tokio" This reverts commit 7891d2848deb9ddf7d1190f91aa166258b04a332. --- Cargo.lock | 13 +++++++++++++ Cargo.toml | 3 +++ pumpkin/Cargo.toml | 3 +-- pumpkin/src/main.rs | 3 ++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 55ce38c49..3523957da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1177,6 +1177,7 @@ dependencies = [ "sha1", "simple_logger", "thiserror", + "tokio", "toml", "uuid", ] @@ -1788,9 +1789,21 @@ dependencies = [ "mio", "pin-project-lite", "socket2", + "tokio-macros", "windows-sys 0.52.0", ] +[[package]] +name = "tokio-macros" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "tokio-native-tls" version = "0.3.1" diff --git a/Cargo.toml b/Cargo.toml index 7ce9d72cc..158cf41d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,3 +8,6 @@ edition = "2021" [profile.release] lto = true + +[workspace.dependencies] +tokio = { version = "1.39.2", features = ["net", "macros", "rt-multi-thread", "fs", "io-util"] } diff --git a/pumpkin/Cargo.toml b/pumpkin/Cargo.toml index 3f9fe1c1a..2572cf185 100644 --- a/pumpkin/Cargo.toml +++ b/pumpkin/Cargo.toml @@ -49,5 +49,4 @@ crossbeam-channel = "0.5.13" uuid = { version = "1.10", features = ["serde"]} - - +tokio.workspace = true \ No newline at end of file diff --git a/pumpkin/src/main.rs b/pumpkin/src/main.rs index 66bae804f..84b445fb9 100644 --- a/pumpkin/src/main.rs +++ b/pumpkin/src/main.rs @@ -23,7 +23,8 @@ pub mod server; pub mod util; #[cfg(not(target_os = "wasi"))] -fn main() -> io::Result<()> { +#[tokio::main] +async fn main() -> io::Result<()> { use std::{cell::RefCell, time::Instant}; let time = Instant::now();