From 06abdff4bfad9e56ec18b6de71240ac229554edf Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Sun, 17 Jan 2021 20:07:52 +0100 Subject: [PATCH] cargo fmt (#303) --- src/error.rs | 14 ++++++++++++-- src/unit.rs | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/error.rs b/src/error.rs index dc8eb71..5e5fda1 100644 --- a/src/error.rs +++ b/src/error.rs @@ -313,11 +313,21 @@ fn status_code_error_redirect() { test::set_handler("/redirect_a", |unit| { assert_eq!(unit.method, "GET"); - test::make_response(302, "Go here", vec!["Location: test://example.edu/redirect_b"], vec![]) + test::make_response( + 302, + "Go here", + vec!["Location: test://example.edu/redirect_b"], + vec![], + ) }); test::set_handler("/redirect_b", |unit| { assert_eq!(unit.method, "GET"); - test::make_response(302, "Go here", vec!["Location: http://example.com/status/500"], vec![]) + test::make_response( + 302, + "Go here", + vec!["Location: http://example.com/status/500"], + vec![], + ) }); let err = get("test://example.org/redirect_a").call().unwrap_err(); diff --git a/src/unit.rs b/src/unit.rs index e42de6c..1ba0686 100644 --- a/src/unit.rs +++ b/src/unit.rs @@ -80,7 +80,8 @@ impl Unit { let username = url.username(); let password = url.password().unwrap_or(""); - if (!username.is_empty() || !password.is_empty()) && 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)));