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

@@ -137,7 +137,6 @@ impl Client<(), Body> {
/// # Example
///
/// ```
/// # extern crate hyper;
/// # #[cfg(feature = "runtime")]
/// # fn run () {
/// use hyper::Client;
@@ -175,7 +174,6 @@ where C: Connect + Sync + 'static,
/// # Example
///
/// ```
/// # extern crate hyper;
/// # #[cfg(feature = "runtime")]
/// # fn run () {
/// use hyper::{Client, Uri};
@@ -205,7 +203,6 @@ where C: Connect + Sync + 'static,
/// # Example
///
/// ```
/// # extern crate hyper;
/// # #[cfg(feature = "runtime")]
/// # fn run () {
/// use hyper::{Body, Client, Request};
@@ -558,7 +555,7 @@ impl<C, B> Clone for Client<C, B> {
}
impl<C, B> fmt::Debug for Client<C, B> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Client")
.finish()
}
@@ -580,7 +577,7 @@ impl ResponseFuture {
}
impl fmt::Debug for ResponseFuture {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.pad("Future<Response>")
}
}
@@ -821,7 +818,6 @@ fn set_scheme(uri: &mut Uri, scheme: Scheme) {
/// # Example
///
/// ```
/// # extern crate hyper;
/// # #[cfg(feature = "runtime")]
/// # fn run () {
/// use hyper::Client;
@@ -1053,7 +1049,7 @@ impl Builder {
}
impl fmt::Debug for Builder {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Builder")
.field("client_config", &self.client_config)
.field("conn_builder", &self.conn_builder)
@@ -1097,7 +1093,6 @@ mod unit_tests {
#[test]
fn test_authority_form() {
extern crate pretty_env_logger;
let _ = pretty_env_logger::try_init();
let mut uri = "http://hyper.rs".parse().unwrap();