style(lib): use rust 2018 edition idioms (#1910)

This commit is contained in:
lzutao
2019-08-22 01:22:07 +07:00
committed by Sean McArthur
parent ae75b3a732
commit fc7f81b67c
38 changed files with 90 additions and 146 deletions

View File

@@ -75,13 +75,13 @@ impl Name {
}
impl fmt::Debug for Name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Debug::fmt(&self.host, f)
}
}
impl fmt::Display for Name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(&self.host, f)
}
}
@@ -100,7 +100,7 @@ impl FromStr for Name {
pub struct InvalidNameError(());
impl fmt::Display for InvalidNameError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("Not a valid domain name")
}
}
@@ -166,7 +166,7 @@ impl Resolve for GaiResolver {
}
impl fmt::Debug for GaiResolver {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.pad("GaiResolver")
}
}
@@ -184,7 +184,7 @@ impl Future for GaiFuture {
}
impl fmt::Debug for GaiFuture {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.pad("GaiFuture")
}
}
@@ -198,7 +198,7 @@ impl Iterator for GaiAddrs {
}
impl fmt::Debug for GaiAddrs {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.pad("GaiAddrs")
}
}