1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-22 08:07:18 +00:00

change InitError type

This commit is contained in:
Nikolay Kim 2018-09-07 11:42:22 -07:00
parent db1fe14fd2
commit 8298da0f4a
2 changed files with 5 additions and 6 deletions

View file

@ -151,7 +151,7 @@ impl Server {
where where
F: Fn() -> N + Clone + Send + 'static, F: Fn() -> N + Clone + Send + 'static,
U: net::ToSocketAddrs, U: net::ToSocketAddrs,
N: NewService<Request = TcpStream, Response = (), InitError = io::Error> + 'static, N: NewService<Request = TcpStream, Response = (), InitError = ()> + 'static,
N::Service: 'static, N::Service: 'static,
N::Future: 'static, N::Future: 'static,
N::Error: fmt::Display, N::Error: fmt::Display,
@ -168,7 +168,7 @@ impl Server {
pub fn listen<F, N>(mut self, lst: net::TcpListener, factory: F) -> Self pub fn listen<F, N>(mut self, lst: net::TcpListener, factory: F) -> Self
where where
F: Fn() -> N + Clone + Send + 'static, F: Fn() -> N + Clone + Send + 'static,
N: NewService<Request = TcpStream, Response = (), InitError = io::Error> + 'static, N: NewService<Request = TcpStream, Response = (), InitError = ()> + 'static,
N::Service: 'static, N::Service: 'static,
N::Future: 'static, N::Future: 'static,
N::Error: fmt::Display, N::Error: fmt::Display,

View file

@ -1,7 +1,7 @@
use std::cell::Cell; use std::cell::Cell;
use std::rc::Rc; use std::rc::Rc;
use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::atomic::{AtomicUsize, Ordering};
use std::{fmt, io, net}; use std::{fmt, net};
use futures::task::AtomicTask; use futures::task::AtomicTask;
use futures::{future, Async, Future, Poll}; use futures::{future, Async, Future, Poll};
@ -102,7 +102,7 @@ where
impl<F, T> ServerNewService<F, T> impl<F, T> ServerNewService<F, T>
where where
F: Fn() -> T + Send + Clone + 'static, F: Fn() -> T + Send + Clone + 'static,
T: NewService<Request = TcpStream, Response = (), InitError = io::Error> + 'static, T: NewService<Request = TcpStream, Response = (), InitError = ()> + 'static,
T::Service: 'static, T::Service: 'static,
T::Future: 'static, T::Future: 'static,
T::Error: fmt::Display, T::Error: fmt::Display,
@ -121,7 +121,7 @@ pub trait ServerServiceFactory {
impl<F, T> ServerServiceFactory for ServerNewService<F, T> impl<F, T> ServerServiceFactory for ServerNewService<F, T>
where where
F: Fn() -> T + Send + Clone + 'static, F: Fn() -> T + Send + Clone + 'static,
T: NewService<Request = TcpStream, Response = (), InitError = io::Error> + 'static, T: NewService<Request = TcpStream, Response = (), InitError = ()> + 'static,
T::Service: 'static, T::Service: 'static,
T::Future: 'static, T::Future: 'static,
T::Error: fmt::Display, T::Error: fmt::Display,
@ -136,7 +136,6 @@ where
Box::new( Box::new(
(self.inner)() (self.inner)()
.new_service() .new_service()
.map_err(|_| ())
.map(move |inner| { .map(move |inner| {
let service: BoxedServerService = Box::new(ServerService::new(inner)); let service: BoxedServerService = Box::new(ServerService::new(inner));
service service