mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-26 15:07:42 +02:00
migrate to -utils beta 4 (#2127)
This commit is contained in:
@ -3,11 +3,9 @@ use actix_http::{
|
||||
};
|
||||
use actix_http_test::test_server;
|
||||
use actix_service::ServiceFactoryExt;
|
||||
use actix_utils::future;
|
||||
use bytes::Bytes;
|
||||
use futures_util::{
|
||||
future::{self, ok},
|
||||
StreamExt as _,
|
||||
};
|
||||
use futures_util::StreamExt as _;
|
||||
|
||||
const STR: &str = "Hello World Hello World Hello World Hello World Hello World \
|
||||
Hello World Hello World Hello World Hello World Hello World \
|
||||
@ -63,7 +61,7 @@ async fn test_h1_v2() {
|
||||
async fn test_connection_close() {
|
||||
let srv = test_server(move || {
|
||||
HttpService::build()
|
||||
.finish(|_| ok::<_, ()>(Response::Ok().body(STR)))
|
||||
.finish(|_| future::ok::<_, ()>(Response::Ok().body(STR)))
|
||||
.tcp()
|
||||
.map(|_| ())
|
||||
})
|
||||
@ -79,9 +77,9 @@ async fn test_with_query_parameter() {
|
||||
HttpService::build()
|
||||
.finish(|req: Request| {
|
||||
if req.uri().query().unwrap().contains("qp=") {
|
||||
ok::<_, ()>(Response::Ok().finish())
|
||||
future::ok::<_, ()>(Response::Ok().finish())
|
||||
} else {
|
||||
ok::<_, ()>(Response::BadRequest().finish())
|
||||
future::ok::<_, ()>(Response::BadRequest().finish())
|
||||
}
|
||||
})
|
||||
.tcp()
|
||||
|
Reference in New Issue
Block a user