Remove tokio's macros feature

This commit is contained in:
blank X 2020-12-02 12:17:37 +07:00
parent a986e78cd7
commit de26021e5d
3 changed files with 10 additions and 17 deletions

14
Cargo.lock generated
View File

@ -1097,7 +1097,7 @@ dependencies = [
[[package]]
name = "rss-anime-notifier-rs"
version = "0.1.3"
version = "0.1.4"
dependencies = [
"chrono",
"reqwest",
@ -1308,18 +1308,6 @@ dependencies = [
"mio",
"pin-project-lite",
"slab",
"tokio-macros",
]
[[package]]
name = "tokio-macros"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]

View File

@ -1,6 +1,6 @@
[package]
name = "rss-anime-notifier-rs"
version = "0.1.3"
version = "0.1.4"
authors = ["blank X <theblankx@protonmail.com>"]
edition = "2018"
@ -16,4 +16,4 @@ chrono = "0.4.19"
serde_json = "1.0"
reqwest = "0.10.8"
serde = { version = "1.0.117", features = ["derive"] }
tokio = { version = "0.2.22", features = ["rt-core", "macros"] }
tokio = { version = "0.2.22", features = ["rt-core"] }

View File

@ -141,8 +141,7 @@ async fn give_response(anime_id: usize, client: Client) -> Result<impl warp::Rep
.body(channel.to_string()))
}
#[tokio::main]
async fn main() {
async fn async_main() {
let port = match env::var("PORT") {
Ok(port) => port.parse::<u16>().unwrap(),
Err(_) => 8080
@ -156,3 +155,9 @@ async fn main() {
eprintln!("INFO: Listening on 127.0.0.1:{}", port);
warp::serve(routes).run(([127, 0, 0, 1], port)).await;
}
fn main() {
tokio::runtime::Runtime::new()
.unwrap()
.block_on(async_main());
}