diff --git a/Cargo.lock b/Cargo.lock index 5e1586f4cbff61504d72d1b2016d9473036e76f3..b24b97fe978539cea50308db7257d17b1ed18976 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,6 +36,16 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "async-attributes" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd3d156917d94862e779f356c5acae312b08fd3121e792c857d7928c8088423" +dependencies = [ + "quote 1.0.8", + "syn 1.0.56", +] + [[package]] name = "async-channel" version = "1.5.1" @@ -110,6 +120,7 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f9f84f1280a2b436a2c77c2582602732b6c2f4321d5494d6e799e6c367859a8" dependencies = [ + "async-attributes", "async-channel", "async-global-executor", "async-io", diff --git a/Cargo.toml b/Cargo.toml index 1a48cf29ca300918cf54f82f65cfbdbe49b26a97..2ede2e1bbca4c7d5f27ded155f0132b8f1e69482 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ impl_ops = "0.1.1" ctrlc = { version = "3.0", features = ["termination"] } async-tungstenite = { version = "0.10.0", features = ["async-std-runtime"] } rauth = { git = "https://gitlab.insrt.uk/insert/rauth" } -async-std = { version = "1.8.0", features = ["tokio02"] } +async-std = { version = "1.8.0", features = ["tokio02", "attributes"] } hive_pubsub = { version = "0.4.3", features = ["mongo"] } rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" } diff --git a/src/main.rs b/src/main.rs index 8c55f5b9ccc1d3fe5b09ce895e9eb8578a5c8ca2..e0f1d12f9124c20acfa8a1689ff97fd64b4073d8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,17 +18,13 @@ pub mod notifications; pub mod routes; pub mod util; -use async_std::task; use futures::join; use log::info; use rauth; use rocket_cors::AllowedOrigins; -fn main() { - task::block_on(entry()) -} - -async fn entry() { +#[async_std::main] +async fn main() { dotenv::dotenv().ok(); env_logger::init_from_env(env_logger::Env::default().filter_or("RUST_LOG", "info"));