mirror of
https://github.com/actix/actix-web.git
synced 2024-12-21 23:56:35 +00:00
change InitError type
This commit is contained in:
parent
db1fe14fd2
commit
8298da0f4a
2 changed files with 5 additions and 6 deletions
|
@ -151,7 +151,7 @@ impl Server {
|
|||
where
|
||||
F: Fn() -> N + Clone + Send + 'static,
|
||||
U: net::ToSocketAddrs,
|
||||
N: NewService<Request = TcpStream, Response = (), InitError = io::Error> + 'static,
|
||||
N: NewService<Request = TcpStream, Response = (), InitError = ()> + 'static,
|
||||
N::Service: 'static,
|
||||
N::Future: 'static,
|
||||
N::Error: fmt::Display,
|
||||
|
@ -168,7 +168,7 @@ impl Server {
|
|||
pub fn listen<F, N>(mut self, lst: net::TcpListener, factory: F) -> Self
|
||||
where
|
||||
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::Future: 'static,
|
||||
N::Error: fmt::Display,
|
||||
|
|
|
@ -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<F, T> ServerNewService<F, T>
|
||||
where
|
||||
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::Future: 'static,
|
||||
T::Error: fmt::Display,
|
||||
|
@ -121,7 +121,7 @@ pub trait ServerServiceFactory {
|
|||
impl<F, T> ServerServiceFactory for ServerNewService<F, T>
|
||||
where
|
||||
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::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
|
||||
|
|
Loading…
Reference in a new issue