diff --git a/Cargo.toml b/Cargo.toml index a984025..f8bf215 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,9 +21,9 @@ tls = ["rustls", "webpki", "webpki-roots"] cookies = ["cookie"] [dependencies] -base64 = "0.11" +base64 = "0.12" chunked_transfer = "1" -cookie = { version = "0.12", features = ["percent-encode"], optional = true} +cookie = { version = "0.13", features = ["percent-encode"], optional = true} lazy_static = "1" qstring = "0.7" url = "2" diff --git a/src/request.rs b/src/request.rs index 11a7c0c..09e8ee8 100644 --- a/src/request.rs +++ b/src/request.rs @@ -132,7 +132,7 @@ impl Request { /// ``` #[cfg(feature = "json")] pub fn send_json(&mut self, data: SerdeValue) -> Response { - if let None = self.header("Content-Type") { + if self.header("Content-Type").is_none() { self.set("Content-Type", "application/json"); } self.do_call(Payload::JSON(data)) diff --git a/src/response.rs b/src/response.rs index 0055526..8db8fcb 100644 --- a/src/response.rs +++ b/src/response.rs @@ -718,11 +718,9 @@ mod tests { #[test] #[cfg(feature = "json")] fn parse_simple_json() { - let s = format!( - "HTTP/1.1 200 OK\r\n\ + let s = "HTTP/1.1 200 OK\r\n\ \r\n\ - {{\"hello\":\"world\"}}" - ); + {\"hello\":\"world\"}"; let resp = s.parse::().unwrap(); let v = resp.into_json().unwrap(); let compare = "{\"hello\":\"world\"}" diff --git a/src/stream.rs b/src/stream.rs index 4d25896..74cf7b2 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -83,6 +83,7 @@ fn read_https( } } +#[allow(deprecated)] fn is_close_notify(e: &std::io::Error) -> bool { if e.kind() != std::io::ErrorKind::ConnectionAborted { return false;