Clean up unused code and long imports. (#137)

This removes some commented out methods, and also changes instances of
::std::foo to use a more idiomatic import path.
This commit is contained in:
Jacob Hoffman-Andrews
2020-09-12 18:42:15 -07:00
committed by GitHub
parent 50c19c5484
commit 6a88c2c8bf
6 changed files with 22 additions and 47 deletions

View File

@@ -1,16 +1,12 @@
use std::fmt;
use std::io::Read;
use std::result::Result;
use std::sync::{Arc, Mutex};
use std::time;
use qstring::QString;
use url::{form_urlencoded, Url};
#[cfg(feature = "tls")]
use std::fmt;
#[cfg(all(feature = "native-tls", not(feature = "tls")))]
use std::fmt;
use crate::agent::{self, Agent, AgentState};
use crate::body::{Payload, SizedReader};
use crate::error::Error;
@@ -54,8 +50,8 @@ pub struct Request {
pub(crate) tls_connector: Option<TLSConnector>,
}
impl ::std::fmt::Debug for Request {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::result::Result<(), ::std::fmt::Error> {
impl fmt::Debug for Request {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let (path, query) = self
.to_url()
.map(|u| {
@@ -462,32 +458,6 @@ impl Request {
self
}
// pub fn retry(&self, times: u16) -> Request {
// unimplemented!()
// }
// pub fn sortQuery(&self) -> Request {
// unimplemented!()
// }
// pub fn sortQueryBy(&self, by: Box<Fn(&str, &str) -> usize>) -> Request {
// unimplemented!()
// }
// pub fn ca<S>(&self, accept: S) -> Request
// where S: Into<String> {
// unimplemented!()
// }
// pub fn cert<S>(&self, accept: S) -> Request
// where S: Into<String> {
// unimplemented!()
// }
// pub fn key<S>(&self, accept: S) -> Request
// where S: Into<String> {
// unimplemented!()
// }
// pub fn pfx<S>(&self, accept: S) -> Request // TODO what type? u8?
// where S: Into<String> {
// unimplemented!()
// }
/// Get the method this request is using.
///
/// Example: