fix(all): Add dyn keyword to trait objects

This commit is contained in:
Alexis Mousset
2019-06-11 19:52:35 +02:00
parent 5f75afe05c
commit 0313576fe1
5 changed files with 6 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ impl StdError for Error {
}
}
fn cause(&self) -> Option<&StdError> {
fn cause(&self) -> Option<&dyn StdError> {
match *self {
Io(ref err) => Some(&*err),
JsonSerialization(ref err) => Some(&*err),

View File

@@ -126,7 +126,7 @@ impl Envelope {
}
pub enum Message {
Reader(Box<Read + Send>),
Reader(Box<dyn Read + Send>),
Bytes(Cursor<Vec<u8>>),
}
@@ -158,7 +158,7 @@ impl SendableEmail {
pub fn new_with_reader(
envelope: Envelope,
message_id: String,
message: Box<Read + Send>,
message: Box<dyn Read + Send>,
) -> SendableEmail {
SendableEmail {
envelope,

View File

@@ -34,7 +34,7 @@ impl StdError for Error {
}
}
fn cause(&self) -> Option<&StdError> {
fn cause(&self) -> Option<&dyn StdError> {
match *self {
Io(ref err) => Some(&*err),
Utf8Parsing(ref err) => Some(&*err),

View File

@@ -194,7 +194,7 @@ impl<S: Connector + Write + Read + Timeout + Debug> InnerClient<S> {
}
/// Sends the message content
pub fn message(&mut self, message: Box<Read>) -> SmtpResult {
pub fn message(&mut self, message: Box<dyn Read>) -> SmtpResult {
let mut out_buf: Vec<u8> = vec![];
let mut codec = ClientCodec::new();

View File

@@ -71,7 +71,7 @@ impl StdError for Error {
}
}
fn cause(&self) -> Option<&StdError> {
fn cause(&self) -> Option<&dyn StdError> {
match *self {
ChallengeParsing(ref err) => Some(&*err),
Utf8Parsing(ref err) => Some(&*err),