update Error to implement Send

BREAKING CHANGE: This does change the type of `Error::Serialize`, but
  should only possibly affect those constructing `Error`, not consuming it.
This commit is contained in:
Sean McArthur
2016-11-21 14:43:28 -08:00
parent a580af2a22
commit 20b161096e

View File

@@ -10,7 +10,7 @@ pub enum Error {
/// ///
/// This may be serializing a value that is illegal in JSON or /// This may be serializing a value that is illegal in JSON or
/// form-url-encoded bodies. /// form-url-encoded bodies.
Serialize(Box<StdError>), Serialize(Box<StdError + Send + Sync>),
/// A request tried to redirect too many times. /// A request tried to redirect too many times.
TooManyRedirects, TooManyRedirects,
#[doc(hidden)] #[doc(hidden)]
@@ -50,6 +50,12 @@ impl StdError for Error {
} }
} }
fn _assert_types() {
fn _assert_send<T: Send>() {
}
_assert_send::<Error>();
}
impl From<::hyper::Error> for Error { impl From<::hyper::Error> for Error {
fn from(err: ::hyper::Error) -> Error { fn from(err: ::hyper::Error) -> Error {
Error::Http(err) Error::Http(err)