Update trait object syntax to use 'dyn'
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
extern crate reqwest;
|
||||
extern crate env_logger;
|
||||
|
||||
fn main() -> Result<(), Box<std::error::Error>> {
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
env_logger::init();
|
||||
|
||||
println!("GET https://www.rust-lang.org");
|
||||
|
||||
@@ -118,7 +118,7 @@ impl Body {
|
||||
|
||||
|
||||
enum Kind {
|
||||
Reader(Box<Read + Send>, Option<u64>),
|
||||
Reader(Box<dyn Read + Send>, Option<u64>),
|
||||
Bytes(Bytes),
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ impl<'a> fmt::Debug for DebugLength<'a> {
|
||||
}
|
||||
|
||||
pub(crate) enum Reader {
|
||||
Reader(Box<Read + Send>),
|
||||
Reader(Box<dyn Read + Send>),
|
||||
Bytes(Cursor<Bytes>),
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ impl Read for Reader {
|
||||
}
|
||||
|
||||
pub(crate) struct Sender {
|
||||
body: (Box<Read + Send>, Option<u64>),
|
||||
body: (Box<dyn Read + Send>, Option<u64>),
|
||||
tx: hyper::body::Sender,
|
||||
}
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ pub(crate) trait AsyncConn: AsyncRead + AsyncWrite {}
|
||||
impl<T: AsyncRead + AsyncWrite> AsyncConn for T {}
|
||||
pub(crate) type Conn = Box<dyn AsyncConn + Send + Sync + 'static>;
|
||||
|
||||
pub(crate) type Connecting = Box<Future<Item=(Conn, Connected), Error=io::Error> + Send>;
|
||||
pub(crate) type Connecting = Box<dyn Future<Item=(Conn, Connected), Error=io::Error> + Send>;
|
||||
|
||||
#[cfg(feature = "tls")]
|
||||
fn tunnel<T>(conn: T, host: String, port: u16, auth: Option<::http::header::HeaderValue>) -> Tunnel<T> {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
//! ```
|
||||
//! use reqwest::multipart;
|
||||
//!
|
||||
//! # fn run() -> Result<(), Box<::std::error::Error>> {
|
||||
//! # fn run() -> Result<(), Box<dyn std::error::Error>> {
|
||||
//! 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<Box<Read + Send>>,
|
||||
active_reader: Option<Box<dyn Read + Send>>,
|
||||
}
|
||||
|
||||
impl fmt::Debug for Reader {
|
||||
|
||||
@@ -379,7 +379,7 @@ impl Intercept {
|
||||
struct Custom {
|
||||
// This auth only applies if the returned ProxyScheme doesn't have an auth...
|
||||
auth: Option<HeaderValue>,
|
||||
func: Arc<Fn(&Url) -> Option<::Result<ProxyScheme>> + Send + Sync + 'static>,
|
||||
func: Arc<dyn Fn(&Url) -> Option<::Result<ProxyScheme>> + Send + Sync + 'static>,
|
||||
}
|
||||
|
||||
impl Custom {
|
||||
|
||||
@@ -214,7 +214,7 @@ impl<'a> RedirectAttempt<'a> {
|
||||
}
|
||||
|
||||
enum Policy {
|
||||
Custom(Box<Fn(RedirectAttempt) -> RedirectAction + Send + Sync + 'static>),
|
||||
Custom(Box<dyn Fn(RedirectAttempt) -> RedirectAction + Send + Sync + 'static>),
|
||||
Limit(usize),
|
||||
None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user