1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-26 19:47:43 +02:00

rename fn service helpers

This commit is contained in:
Nikolay Kim
2019-12-08 19:05:05 +06:00
parent c38a25f102
commit 1ad0bbfb7f
12 changed files with 109 additions and 41 deletions

View File

@ -115,7 +115,7 @@ mod tests {
use std::time::Duration;
use super::*;
use actix_service::{apply, factory_fn, Service, ServiceFactory};
use actix_service::{apply, fn_factory, Service, ServiceFactory};
use futures::future::{lazy, ok, FutureExt, LocalBoxFuture};
struct SleepService(Duration);
@ -155,7 +155,7 @@ mod tests {
async fn test_newtransform() {
let wait_time = Duration::from_millis(50);
let srv = apply(InFlight::new(1), factory_fn(|| ok(SleepService(wait_time))));
let srv = apply(InFlight::new(1), fn_factory(|| ok(SleepService(wait_time))));
let mut srv = srv.new_service(&()).await.unwrap();
assert_eq!(lazy(|cx| srv.poll_ready(cx)).await, Poll::Ready(Ok(())));

View File

@ -182,7 +182,7 @@ mod tests {
use std::time::Duration;
use super::*;
use actix_service::{apply, factory_fn, Service, ServiceFactory};
use actix_service::{apply, fn_factory, Service, ServiceFactory};
use futures::future::{ok, FutureExt, LocalBoxFuture};
struct SleepService(Duration);
@ -229,7 +229,7 @@ mod tests {
let timeout = apply(
Timeout::new(resolution),
factory_fn(|| ok::<_, ()>(SleepService(wait_time))),
fn_factory(|| ok::<_, ()>(SleepService(wait_time))),
);
let mut srv = timeout.new_service(&()).await.unwrap();