From 8298da0f4a2d456ef54a04ead8f041d96bf0818c Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 7 Sep 2018 11:42:22 -0700 Subject: [PATCH] change InitError type --- src/server.rs | 4 ++-- src/server_service.rs | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/server.rs b/src/server.rs index a5e23d297..c61a3f56d 100644 --- a/src/server.rs +++ b/src/server.rs @@ -151,7 +151,7 @@ impl Server { where F: Fn() -> N + Clone + Send + 'static, U: net::ToSocketAddrs, - N: NewService + 'static, + N: NewService + 'static, N::Service: 'static, N::Future: 'static, N::Error: fmt::Display, @@ -168,7 +168,7 @@ impl Server { pub fn listen(mut self, lst: net::TcpListener, factory: F) -> Self where F: Fn() -> N + Clone + Send + 'static, - N: NewService + 'static, + N: NewService + 'static, N::Service: 'static, N::Future: 'static, N::Error: fmt::Display, diff --git a/src/server_service.rs b/src/server_service.rs index 0afc99d90..e6292f64f 100644 --- a/src/server_service.rs +++ b/src/server_service.rs @@ -1,7 +1,7 @@ use std::cell::Cell; use std::rc::Rc; use std::sync::atomic::{AtomicUsize, Ordering}; -use std::{fmt, io, net}; +use std::{fmt, net}; use futures::task::AtomicTask; use futures::{future, Async, Future, Poll}; @@ -102,7 +102,7 @@ where impl ServerNewService where F: Fn() -> T + Send + Clone + 'static, - T: NewService + 'static, + T: NewService + 'static, T::Service: 'static, T::Future: 'static, T::Error: fmt::Display, @@ -121,7 +121,7 @@ pub trait ServerServiceFactory { impl ServerServiceFactory for ServerNewService where F: Fn() -> T + Send + Clone + 'static, - T: NewService + 'static, + T: NewService + 'static, T::Service: 'static, T::Future: 'static, T::Error: fmt::Display, @@ -136,7 +136,6 @@ where Box::new( (self.inner)() .new_service() - .map_err(|_| ()) .map(move |inner| { let service: BoxedServerService = Box::new(ServerService::new(inner)); service