Address edition-2018 idioms. (#929)

This commit is contained in:
Roman Borschel
2019-02-11 14:58:15 +01:00
committed by Pierre Krieger
parent 21810e46bd
commit eeed66707b
75 changed files with 308 additions and 516 deletions

View File

@ -66,7 +66,7 @@ impl error::Error for ProtocolChoiceError {
}
}
fn cause(&self) -> Option<&error::Error> {
fn cause(&self) -> Option<&dyn error::Error> {
match *self {
ProtocolChoiceError::MultistreamSelectError(ref err) => Some(err),
_ => None,
@ -76,7 +76,7 @@ impl error::Error for ProtocolChoiceError {
impl fmt::Display for ProtocolChoiceError {
#[inline]
fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
write!(fmt, "{}", error::Error::description(self))
}
}

View File

@ -77,7 +77,7 @@ impl error::Error for MultistreamSelectError {
}
}
fn cause(&self) -> Option<&error::Error> {
fn cause(&self) -> Option<&dyn error::Error> {
match *self {
MultistreamSelectError::IoError(ref err) => Some(err),
_ => None,
@ -87,7 +87,7 @@ impl error::Error for MultistreamSelectError {
impl fmt::Display for MultistreamSelectError {
#[inline]
fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
write!(fmt, "{}", error::Error::description(self))
}
}