From a8b2f1b82127eb6eacc1caf2db00559ee02e20d7 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 15 Dec 2017 18:49:11 -0800 Subject: [PATCH] update tests --- src/middlewares/defaultheaders.rs | 4 ++-- src/pipeline.rs | 2 +- tests/test_server.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/middlewares/defaultheaders.rs b/src/middlewares/defaultheaders.rs index 6766e1fa4..6968c8978 100644 --- a/src/middlewares/defaultheaders.rs +++ b/src/middlewares/defaultheaders.rs @@ -112,14 +112,14 @@ mod tests { let mut req = HttpRequest::default(); let resp = HttpResponse::Ok().finish().unwrap(); - let resp = match mw.response(&mut req, Box::new(resp)) { + let resp = match mw.response(&mut req, resp) { Response::Done(resp) => resp, _ => panic!(), }; assert_eq!(resp.headers().get(CONTENT_TYPE).unwrap(), "0001"); let resp = HttpResponse::Ok().header(CONTENT_TYPE, "0002").finish().unwrap(); - let resp = match mw.response(&mut req, Box::new(resp)) { + let resp = match mw.response(&mut req, resp) { Response::Done(resp) => resp, _ => panic!(), }; diff --git a/src/pipeline.rs b/src/pipeline.rs index 2073ff608..91a387534 100644 --- a/src/pipeline.rs +++ b/src/pipeline.rs @@ -899,7 +899,7 @@ mod tests { let mut ctx = HttpContext::new(req.clone(), MyActor); let addr: Address<_> = ctx.address(); let mut info = PipelineInfo::new(req); - info.context = Some(ctx); + info.context = Some(Box::new(ctx)); let mut state = Completed::init(&mut info).completed().unwrap(); let st = state.poll(&mut info).ok().unwrap(); diff --git a/tests/test_server.rs b/tests/test_server.rs index 65a0a38e1..53dacbbaa 100644 --- a/tests/test_server.rs +++ b/tests/test_server.rs @@ -59,7 +59,7 @@ impl middlewares::Middleware for MiddlewareTest { middlewares::Started::Done } - fn response(&self, _: &mut HttpRequest, resp: Box) -> middlewares::Response { + fn response(&self, _: &mut HttpRequest, resp: HttpResponse) -> middlewares::Response { self.response.store(self.response.load(Ordering::Relaxed) + 1, Ordering::Relaxed); middlewares::Response::Done(resp) }