diff --git a/src/configurable.rs b/src/configurable.rs index 614a491d0..1f6734239 100644 --- a/src/configurable.rs +++ b/src/configurable.rs @@ -349,7 +349,7 @@ where self.a = Some(service); } - if let Async::Ready(service) = self.fut_b.poll().map_err(|e| e.into())? { + if let Async::Ready(service) = self.fut_b.poll()? { self.b = Some(service); } diff --git a/src/lib.rs b/src/lib.rs index 60533ff39..9293b9085 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,6 +8,14 @@ //! // #![warn(missing_docs)] +#![cfg_attr( + feature = "cargo-clippy", + allow( + declare_interior_mutable_const, + borrow_interior_mutable_const + ) +)] + #[macro_use] extern crate log; extern crate bytes; diff --git a/src/server.rs b/src/server.rs index c80410054..43e67a689 100644 --- a/src/server.rs +++ b/src/server.rs @@ -1,5 +1,5 @@ use std::time::Duration; -use std::{fmt, io, mem, net}; +use std::{io, mem, net}; use futures::sync::{mpsc, mpsc::unbounded}; use futures::{Future, Sink, Stream}; @@ -150,7 +150,6 @@ impl Server { N: NewService + 'static, N::Service: 'static, N::Future: 'static, - N::Error: fmt::Display, { let sockets = bind_addr(addr)?; @@ -167,7 +166,6 @@ impl Server { N: NewService + 'static, N::Service: 'static, N::Future: 'static, - N::Error: fmt::Display, { let token = Token(self.services.len()); self.services.push(ServerNewService::create(factory)); diff --git a/src/server_service.rs b/src/server_service.rs index 6debdbdb5..d597c5c08 100644 --- a/src/server_service.rs +++ b/src/server_service.rs @@ -1,7 +1,7 @@ use std::cell::Cell; +use std::net; use std::rc::Rc; use std::sync::atomic::{AtomicUsize, Ordering}; -use std::{fmt, net}; use futures::future::{err, ok}; use futures::task::AtomicTask; @@ -64,7 +64,7 @@ impl Service for ServerService where T: Service, T::Future: 'static, - T::Error: fmt::Display + 'static, + T::Error: 'static, { type Request = ServerMessage; type Response = (); @@ -117,7 +117,6 @@ where T: NewService + 'static, T::Service: 'static, T::Future: 'static, - T::Error: fmt::Display, { pub(crate) fn create(inner: F) -> Box { Box::new(Self { inner }) @@ -136,7 +135,6 @@ where T: NewService + 'static, T::Service: 'static, T::Future: 'static, - T::Error: fmt::Display, { fn clone_factory(&self) -> Box { Box::new(Self { diff --git a/src/service/and_then.rs b/src/service/and_then.rs index ef3a31146..922e10ed0 100644 --- a/src/service/and_then.rs +++ b/src/service/and_then.rs @@ -51,7 +51,7 @@ where fn poll_ready(&mut self) -> Poll<(), Self::Error> { match self.a.poll_ready() { - Ok(Async::Ready(_)) => self.b.borrow_mut().poll_ready().map_err(|e| e.into()), + Ok(Async::Ready(_)) => self.b.borrow_mut().poll_ready(), Ok(Async::NotReady) => Ok(Async::NotReady), Err(err) => Err(err), } @@ -97,7 +97,7 @@ where fn poll(&mut self) -> Poll { if let Some(ref mut fut) = self.fut_b { - return fut.poll().map_err(|e| e.into()); + return fut.poll(); } match self.fut_a.poll() { @@ -204,7 +204,7 @@ where } if self.b.is_none() { - if let Async::Ready(service) = self.fut_b.poll().map_err(|e| e.into())? { + if let Async::Ready(service) = self.fut_b.poll()? { self.b = Some(service); } }