From c81ce40058b86a2f9169ca430b487731638638c5 Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Thu, 29 Oct 2020 01:57:42 +0800 Subject: [PATCH] fix attributes and clippy check --- actix-rt/src/lib.rs | 2 +- actix-server/tests/test_server.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/actix-rt/src/lib.rs b/actix-rt/src/lib.rs index 8d12e88f..8097ca05 100644 --- a/actix-rt/src/lib.rs +++ b/actix-rt/src/lib.rs @@ -1,5 +1,5 @@ //! A runtime implementation that runs everything on the current thread. -#![deny(rust_2018_idioms, warnings)] +#![deny(rust_2018_idioms)] #![forbid(unsafe_code)] use std::future::Future; diff --git a/actix-server/tests/test_server.rs b/actix-server/tests/test_server.rs index e62953c7..838c3cf1 100644 --- a/actix-server/tests/test_server.rs +++ b/actix-server/tests/test_server.rs @@ -24,14 +24,14 @@ fn test_bind() { let h = thread::spawn(move || { let mut sys = actix_rt::System::new("test"); - let srv = sys.block_on(async { + let srv = sys.block_on(lazy(|_| { Server::build() .workers(1) .disable_signals() .bind("test", addr, move || fn_service(|_| ok::<_, ()>(()))) .unwrap() .start() - }); + })); let _ = tx.send((srv, actix_rt::System::current())); let _ = sys.run(); }); @@ -51,14 +51,14 @@ fn test_listen() { let h = thread::spawn(move || { let mut sys = actix_rt::System::new("test"); let lst = net::TcpListener::bind(addr).unwrap(); - sys.block_on(async { + sys.block_on(lazy(|_| { Server::build() .disable_signals() .workers(1) .listen("test", lst, move || fn_service(|_| ok::<_, ()>(()))) .unwrap() .start() - }); + })); let _ = tx.send(actix_rt::System::current()); let _ = sys.run(); }); @@ -84,7 +84,7 @@ fn test_start() { let h = thread::spawn(move || { let mut sys = actix_rt::System::new("test"); - let srv = sys.block_on(async { + let srv = sys.block_on(lazy(|_| { Server::build() .backlog(100) .disable_signals() @@ -97,7 +97,7 @@ fn test_start() { }) .unwrap() .start() - }); + })); let _ = tx.send((srv, actix_rt::System::current())); let _ = sys.run(); @@ -152,7 +152,7 @@ fn test_configure() { let h = thread::spawn(move || { let num = num2.clone(); let mut sys = actix_rt::System::new("test"); - let srv = sys.block_on(async { + let srv = sys.block_on(lazy(|_| { Server::build() .disable_signals() .configure(move |cfg| { @@ -175,7 +175,7 @@ fn test_configure() { .unwrap() .workers(1) .start() - }); + })); let _ = tx.send((srv, actix_rt::System::current())); let _ = sys.run(); });