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

@@ -256,20 +256,21 @@ pub(crate) fn basic_auth(user: &str, pass: &str) -> String {
Some(idx) => &user[..idx],
None => user,
};
::base64::encode(&format!("{}:{}", safe, pass))
base64::encode(&format!("{}:{}", safe, pass))
}
#[cfg(test)]
mod tests {
use super::*;
use std::io::Read;
use std::thread;
///////////////////// AGENT TESTS //////////////////////////////
#[test]
fn agent_implements_send() {
let mut agent = Agent::new();
::std::thread::spawn(move || {
thread::spawn(move || {
agent.set("Foo", "Bar");
});
}
@@ -309,7 +310,7 @@ mod tests {
fn request_implements_send() {
let agent = Agent::new();
let mut request = Request::new(&agent, "GET".to_string(), "/foo".to_string());
::std::thread::spawn(move || {
thread::spawn(move || {
request.set("Foo", "Bar");
});
}