chore(lib): add dyn keyword to trait objects (#1820)
				
					
				
			Requires Rust 1.27.
This commit is contained in:
		| @@ -1,4 +1,5 @@ | ||||
| use std::borrow::Cow; | ||||
| use std::error::Error as StdError; | ||||
| use std::fmt; | ||||
|  | ||||
| use bytes::Bytes; | ||||
| @@ -39,7 +40,7 @@ enum Kind { | ||||
|         content_length: Option<u64>, | ||||
|         recv: h2::RecvStream, | ||||
|     }, | ||||
|     Wrapped(Box<Stream<Item = Chunk, Error = Box<::std::error::Error + Send + Sync>> + Send>), | ||||
|     Wrapped(Box<dyn Stream<Item = Chunk, Error = Box<dyn StdError + Send + Sync>> + Send>), | ||||
| } | ||||
|  | ||||
| struct Extra { | ||||
| @@ -141,7 +142,7 @@ impl Body { | ||||
|     pub fn wrap_stream<S>(stream: S) -> Body | ||||
|     where | ||||
|         S: Stream + Send + 'static, | ||||
|         S::Error: Into<Box<::std::error::Error + Send + Sync>>, | ||||
|         S::Error: Into<Box<dyn StdError + Send + Sync>>, | ||||
|         Chunk: From<S::Item>, | ||||
|     { | ||||
|         let mapped = stream.map(Chunk::from).map_err(Into::into); | ||||
| @@ -457,13 +458,13 @@ impl From<Chunk> for Body { | ||||
| } | ||||
|  | ||||
| impl | ||||
|     From<Box<Stream<Item = Chunk, Error = Box<::std::error::Error + Send + Sync>> + Send + 'static>> | ||||
|     From<Box<dyn Stream<Item = Chunk, Error = Box<dyn StdError + Send + Sync>> + Send + 'static>> | ||||
|     for Body | ||||
| { | ||||
|     #[inline] | ||||
|     fn from( | ||||
|         stream: Box< | ||||
|             Stream<Item = Chunk, Error = Box<::std::error::Error + Send + Sync>> + Send + 'static, | ||||
|             dyn Stream<Item = Chunk, Error = Box<dyn StdError + Send + Sync>> + Send + 'static, | ||||
|         >, | ||||
|     ) -> Body { | ||||
|         Body::new(Kind::Wrapped(stream)) | ||||
|   | ||||
| @@ -1,3 +1,5 @@ | ||||
| use std::error::Error as StdError; | ||||
|  | ||||
| use bytes::Buf; | ||||
| use futures::{Async, Poll}; | ||||
| use http::HeaderMap; | ||||
| @@ -13,7 +15,7 @@ pub trait Payload: Send + 'static { | ||||
|     type Data: Buf + Send; | ||||
|  | ||||
|     /// The error type of this stream. | ||||
|     type Error: Into<Box<::std::error::Error + Send + Sync>>; | ||||
|     type Error: Into<Box<dyn StdError + Send + Sync>>; | ||||
|  | ||||
|     /// Poll for a `Data` buffer. | ||||
|     /// | ||||
|   | ||||
		Reference in New Issue
	
	Block a user