Repository: seanmonstar/reqwest (language: rust)

Issue:
Send and Sync in return type of Error::get_ref
[`reqwest::Error::get_ref`](https://docs.rs/reqwest/0.6.2/reqwest/struct.Error.html#method.get_ref) returns `Option<&(std::error::Error + 'static)>`.

In accordance with [this API guideline](https://github.com/brson/rust-api-guidelines#c-send-sync-err), we like for error types to be Send and Sync. This is less important (or maybe not important) for references to trait objects, but here there doesn't seem to be a reason to want the flexibility of returning a non-Send or -Sync type in the future.

Returning `Option<&(std::error::Error + Send + Sync + 'static)>` would be consistent with the signature of [`std::io::Error::get_ref`](https://doc.rust-lang.org/std/io/struct.Error.html#method.get_ref).


Discussion / hints:

Fix patch:
diff --git a/src/error.rs b/src/error.rs
index ec08bfd55..f7727d1b1 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -25,7 +25,7 @@ impl Error {
     /// The `'static` bounds allows using `downcast_ref` to check the
     /// details of the error.
     #[inline]
-    pub fn get_ref(&self) -> Option<&(StdError + 'static)> {
+    pub fn get_ref(&self) -> Option<&(StdError + Send + Sync + 'static)> {
         match self.kind {
             Kind::Http(ref e) => Some(e),
             Kind::UrlEncoded(ref e) => Some(e),


Test patch: