cargo fmt (#604)

Run rustfmt and setup CI to check for it.
This commit is contained in:
danieleades
2019-08-29 17:52:39 +01:00
committed by Sean McArthur
parent 81e0f1ff2a
commit cf8944a0f0
41 changed files with 1399 additions and 1378 deletions

View File

@@ -1,11 +1,10 @@
extern crate reqwest;
#[cfg(feature = "tls")]
#[test]
fn test_badssl_modern() {
let text = reqwest::get("https://mozilla-modern.badssl.com/").unwrap()
.text().unwrap();
let text = reqwest::get("https://mozilla-modern.badssl.com/")
.unwrap()
.text()
.unwrap();
assert!(text.contains("<title>mozilla-modern.badssl.com</title>"));
}
@@ -15,10 +14,13 @@ fn test_badssl_modern() {
fn test_rustls_badssl_modern() {
let text = reqwest::Client::builder()
.use_rustls_tls()
.build().unwrap()
.build()
.unwrap()
.get("https://mozilla-modern.badssl.com/")
.send().unwrap()
.text().unwrap();
.send()
.unwrap()
.text()
.unwrap();
assert!(text.contains("<title>mozilla-modern.badssl.com</title>"));
}
@@ -28,10 +30,13 @@ fn test_rustls_badssl_modern() {
fn test_badssl_self_signed() {
let text = reqwest::Client::builder()
.danger_accept_invalid_certs(true)
.build().unwrap()
.build()
.unwrap()
.get("https://self-signed.badssl.com/")
.send().unwrap()
.text().unwrap();
.send()
.unwrap()
.text()
.unwrap();
assert!(text.contains("<title>self-signed.badssl.com</title>"));
}
@@ -41,17 +46,20 @@ fn test_badssl_self_signed() {
fn test_badssl_wrong_host() {
let text = reqwest::Client::builder()
.danger_accept_invalid_hostnames(true)
.build().unwrap()
.build()
.unwrap()
.get("https://wrong.host.badssl.com/")
.send().unwrap()
.text().unwrap();
.send()
.unwrap()
.text()
.unwrap();
assert!(text.contains("<title>wrong.host.badssl.com</title>"));
let result = reqwest::Client::builder()
.danger_accept_invalid_hostnames(true)
.build().unwrap()
.build()
.unwrap()
.get("https://self-signed.badssl.com/")
.send();