Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor crates for better api stability #301

Merged
merged 14 commits into from
Mar 30, 2021
Prev Previous commit
Next Next commit
clippy
  • Loading branch information
robjtede committed Mar 29, 2021
commit 9b4fe74421031c1c3837e0a79f438c8b6b8c204d
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[alias]
lint = "hack --clean-per-run clippy --workspace --tests"
lint = "hack --clean-per-run clippy --workspace --tests --examples"
15 changes: 8 additions & 7 deletions actix-server/tests/test_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use std::{net, thread, time};

use actix_server::Server;
use actix_service::fn_service;
use futures_util::future::{lazy, ok};
use actix_utils::future::ok;
use futures_util::future::lazy;

fn unused_addr() -> net::SocketAddr {
let addr: net::SocketAddr = "127.0.0.1:0".parse().unwrap();
Expand All @@ -22,14 +23,14 @@ fn test_bind() {

let h = thread::spawn(move || {
let sys = actix_rt::System::new();
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()
.run()
});
}));

let _ = tx.send((srv, actix_rt::System::current()));
let _ = sys.run();
Expand Down Expand Up @@ -83,7 +84,7 @@ fn test_start() {

let h = thread::spawn(move || {
let sys = actix_rt::System::new();
let srv = sys.block_on(async {
let srv = sys.block_on(lazy(|_| {
Server::build()
.backlog(100)
.disable_signals()
Expand All @@ -96,7 +97,7 @@ fn test_start() {
})
.unwrap()
.run()
});
}));

let _ = tx.send((srv, actix_rt::System::current()));
let _ = sys.run();
Expand Down Expand Up @@ -152,7 +153,7 @@ fn test_configure() {
let h = thread::spawn(move || {
let num = num2.clone();
let sys = actix_rt::System::new();
let srv = sys.block_on(async {
let srv = sys.block_on(lazy(|_| {
Server::build()
.disable_signals()
.configure(move |cfg| {
Expand All @@ -175,7 +176,7 @@ fn test_configure() {
.unwrap()
.workers(1)
.run()
});
}));

let _ = tx.send((srv, actix_rt::System::current()));
let _ = sys.run();
Expand Down