1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 14:49:20 +02:00

refactor types

This commit is contained in:
Nikolay Kim
2018-10-04 20:02:10 -07:00
parent b15b2dda22
commit 4ca711909b
15 changed files with 273 additions and 1623 deletions

View File

@ -12,9 +12,8 @@ use actix_net::service::{IntoNewService, IntoService};
use actix_web::{client, test};
use futures::future;
use actix_http::server::h1disp::Http1Dispatcher;
use actix_http::server::{KeepAlive, ServiceConfig};
use actix_http::{Error, HttpResponse};
use actix_http::server::KeepAlive;
use actix_http::{h1, Error, HttpResponse, ServiceConfig};
#[test]
fn test_h1_v2() {
@ -30,17 +29,10 @@ fn test_h1_v2() {
.server_address(addr)
.finish();
(move |io| {
let pool = settings.request_pool();
Http1Dispatcher::new(
io,
pool,
(|req| {
println!("REQ: {:?}", req);
future::ok::<_, Error>(HttpResponse::Ok().finish())
}).into_service(),
)
}).into_new_service()
h1::H1Service::new(settings, |req| {
println!("REQ: {:?}", req);
future::ok::<_, Error>(HttpResponse::Ok().finish())
})
}).unwrap()
.run();
});