fix attributes and clippy check

This commit is contained in:
fakeshadow 2020-10-29 01:57:42 +08:00
parent 4d131ac174
commit c81ce40058
2 changed files with 9 additions and 9 deletions

View File

@ -1,5 +1,5 @@
//! A runtime implementation that runs everything on the current thread. //! A runtime implementation that runs everything on the current thread.
#![deny(rust_2018_idioms, warnings)] #![deny(rust_2018_idioms)]
#![forbid(unsafe_code)] #![forbid(unsafe_code)]
use std::future::Future; use std::future::Future;

View File

@ -24,14 +24,14 @@ fn test_bind() {
let h = thread::spawn(move || { let h = thread::spawn(move || {
let mut sys = actix_rt::System::new("test"); let mut sys = actix_rt::System::new("test");
let srv = sys.block_on(async { let srv = sys.block_on(lazy(|_| {
Server::build() Server::build()
.workers(1) .workers(1)
.disable_signals() .disable_signals()
.bind("test", addr, move || fn_service(|_| ok::<_, ()>(()))) .bind("test", addr, move || fn_service(|_| ok::<_, ()>(())))
.unwrap() .unwrap()
.start() .start()
}); }));
let _ = tx.send((srv, actix_rt::System::current())); let _ = tx.send((srv, actix_rt::System::current()));
let _ = sys.run(); let _ = sys.run();
}); });
@ -51,14 +51,14 @@ fn test_listen() {
let h = thread::spawn(move || { let h = thread::spawn(move || {
let mut sys = actix_rt::System::new("test"); let mut sys = actix_rt::System::new("test");
let lst = net::TcpListener::bind(addr).unwrap(); let lst = net::TcpListener::bind(addr).unwrap();
sys.block_on(async { sys.block_on(lazy(|_| {
Server::build() Server::build()
.disable_signals() .disable_signals()
.workers(1) .workers(1)
.listen("test", lst, move || fn_service(|_| ok::<_, ()>(()))) .listen("test", lst, move || fn_service(|_| ok::<_, ()>(())))
.unwrap() .unwrap()
.start() .start()
}); }));
let _ = tx.send(actix_rt::System::current()); let _ = tx.send(actix_rt::System::current());
let _ = sys.run(); let _ = sys.run();
}); });
@ -84,7 +84,7 @@ fn test_start() {
let h = thread::spawn(move || { let h = thread::spawn(move || {
let mut sys = actix_rt::System::new("test"); let mut sys = actix_rt::System::new("test");
let srv = sys.block_on(async { let srv = sys.block_on(lazy(|_| {
Server::build() Server::build()
.backlog(100) .backlog(100)
.disable_signals() .disable_signals()
@ -97,7 +97,7 @@ fn test_start() {
}) })
.unwrap() .unwrap()
.start() .start()
}); }));
let _ = tx.send((srv, actix_rt::System::current())); let _ = tx.send((srv, actix_rt::System::current()));
let _ = sys.run(); let _ = sys.run();
@ -152,7 +152,7 @@ fn test_configure() {
let h = thread::spawn(move || { let h = thread::spawn(move || {
let num = num2.clone(); let num = num2.clone();
let mut sys = actix_rt::System::new("test"); let mut sys = actix_rt::System::new("test");
let srv = sys.block_on(async { let srv = sys.block_on(lazy(|_| {
Server::build() Server::build()
.disable_signals() .disable_signals()
.configure(move |cfg| { .configure(move |cfg| {
@ -175,7 +175,7 @@ fn test_configure() {
.unwrap() .unwrap()
.workers(1) .workers(1)
.start() .start()
}); }));
let _ = tx.send((srv, actix_rt::System::current())); let _ = tx.send((srv, actix_rt::System::current()));
let _ = sys.run(); let _ = sys.run();
}); });