Fix some clippy lints (#292)
This commit can be replicated with `cargo +nightly clippy --fix -Z unstable-options`, plus an edit to fix another `return` missed by clippy.
This commit is contained in:
@@ -83,7 +83,7 @@ impl Unit {
|
||||
|
||||
let username = url.username();
|
||||
let password = url.password().unwrap_or("");
|
||||
if (username != "" || password != "") && get_header(&headers, "authorization").is_none()
|
||||
if (!username.is_empty() || !password.is_empty()) && get_header(&headers, "authorization").is_none()
|
||||
{
|
||||
let encoded = base64::encode(&format!("{}:{}", username, password));
|
||||
extra.push(Header::new("Authorization", &format!("Basic {}", encoded)));
|
||||
|
||||
Reference in New Issue
Block a user