From 964d87ce57fabf6b27d194adf36af25e4dc0d3b2 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Mon, 3 Jun 2019 13:14:33 -0700 Subject: [PATCH] Update trait object syntax to use 'dyn' --- examples/simple.rs | 2 +- src/body.rs | 6 +++--- src/connect.rs | 2 +- src/error.rs | 2 +- src/multipart.rs | 4 ++-- src/proxy.rs | 2 +- src/redirect.rs | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/simple.rs b/examples/simple.rs index f85c6c9..b8ec8ce 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -5,7 +5,7 @@ extern crate reqwest; extern crate env_logger; -fn main() -> Result<(), Box> { +fn main() -> Result<(), Box> { env_logger::init(); println!("GET https://www.rust-lang.org"); diff --git a/src/body.rs b/src/body.rs index 17b7a0d..e60faa9 100644 --- a/src/body.rs +++ b/src/body.rs @@ -118,7 +118,7 @@ impl Body { enum Kind { - Reader(Box, Option), + Reader(Box, Option), Bytes(Bytes), } @@ -197,7 +197,7 @@ impl<'a> fmt::Debug for DebugLength<'a> { } pub(crate) enum Reader { - Reader(Box), + Reader(Box), Bytes(Cursor), } @@ -211,7 +211,7 @@ impl Read for Reader { } pub(crate) struct Sender { - body: (Box, Option), + body: (Box, Option), tx: hyper::body::Sender, } diff --git a/src/connect.rs b/src/connect.rs index 640510b..667b0cf 100644 --- a/src/connect.rs +++ b/src/connect.rs @@ -385,7 +385,7 @@ pub(crate) trait AsyncConn: AsyncRead + AsyncWrite {} impl AsyncConn for T {} pub(crate) type Conn = Box; -pub(crate) type Connecting = Box + Send>; +pub(crate) type Connecting = Box + Send>; #[cfg(feature = "tls")] fn tunnel(conn: T, host: String, port: u16, auth: Option<::http::header::HeaderValue>) -> Tunnel { diff --git a/src/error.rs b/src/error.rs index 067759e..9f07766 100644 --- a/src/error.rs +++ b/src/error.rs @@ -626,7 +626,7 @@ mod tests { "root" } } - fn cause(&self) -> Option<&StdError> { + fn cause(&self) -> Option<&dyn StdError> { if let Some(ref e) = self.0 { Some(e) } else { diff --git a/src/multipart.rs b/src/multipart.rs index 8cdb0b3..c5b5ebc 100644 --- a/src/multipart.rs +++ b/src/multipart.rs @@ -9,7 +9,7 @@ //! ``` //! use reqwest::multipart; //! -//! # fn run() -> Result<(), Box<::std::error::Error>> { +//! # fn run() -> Result<(), Box> { //! let form = multipart::Form::new() //! // Adding just a simple text field... //! .text("username", "seanmonstar") @@ -282,7 +282,7 @@ impl PartProps for Part { pub(crate) struct Reader { form: Form, - active_reader: Option>, + active_reader: Option>, } impl fmt::Debug for Reader { diff --git a/src/proxy.rs b/src/proxy.rs index ba5912d..a974e45 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -379,7 +379,7 @@ impl Intercept { struct Custom { // This auth only applies if the returned ProxyScheme doesn't have an auth... auth: Option, - func: Arc Option<::Result> + Send + Sync + 'static>, + func: Arc Option<::Result> + Send + Sync + 'static>, } impl Custom { diff --git a/src/redirect.rs b/src/redirect.rs index 86d7578..3314be8 100644 --- a/src/redirect.rs +++ b/src/redirect.rs @@ -214,7 +214,7 @@ impl<'a> RedirectAttempt<'a> { } enum Policy { - Custom(Box RedirectAction + Send + Sync + 'static>), + Custom(Box RedirectAction + Send + Sync + 'static>), Limit(usize), None, }