From 75fbb9748051db5fdb70f8cbc0cb5d1e111ded15 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 2 Mar 2019 13:57:00 -0800 Subject: [PATCH] update new transform trait --- src/handler.rs | 9 ++++----- src/middleware/mod.rs | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/handler.rs b/src/handler.rs index e957d15e..8076d4d4 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -1,8 +1,7 @@ use std::marker::PhantomData; use actix_http::{Error, Response}; -use actix_service::{NewService, Service}; -use actix_utils::Never; +use actix_service::{NewService, Service, Void}; use futures::future::{ok, FutureResult}; use futures::{try_ready, Async, Future, IntoFuture, Poll}; @@ -71,7 +70,7 @@ where { type Request = (T, HttpRequest); type Response = ServiceResponse; - type Error = Never; + type Error = Void; type InitError = (); type Service = HandleService; type Future = FutureResult; @@ -101,7 +100,7 @@ where { type Request = (T, HttpRequest); type Response = ServiceResponse; - type Error = Never; + type Error = Void; type Future = HandleServiceResponse; fn poll_ready(&mut self) -> Poll<(), Self::Error> { @@ -128,7 +127,7 @@ where T::Error: Into, { type Item = ServiceResponse; - type Error = Never; + type Error = Void; fn poll(&mut self) -> Poll { match self.fut.poll() { diff --git a/src/middleware/mod.rs b/src/middleware/mod.rs index a8b4b3c6..8ef316b4 100644 --- a/src/middleware/mod.rs +++ b/src/middleware/mod.rs @@ -47,7 +47,7 @@ where } } -impl NewTransform for MiddlewareFactory +impl NewTransform for MiddlewareFactory where T: Transform + Clone, S: Service, @@ -59,7 +59,7 @@ where type InitError = (); type Future = FutureResult; - fn new_transform(&self) -> Self::Future { + fn new_transform(&self, _: &C) -> Self::Future { ok(self.tr.clone()) } }