From ffb9bddc15f2b6d7dce7500b955a21a6fd7cf638 Mon Sep 17 00:00:00 2001 From: Dec Warner Date: Fri, 10 Jun 2022 12:45:24 +0100 Subject: [PATCH 1/4] bump version --- .github/workflows/ci.yaml | 2 +- clippy.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5b6fb1863..017d870c7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,7 @@ jobs: rust: - stable - nightly - - 1.51 + - 1.56 features: - default - ssl diff --git a/clippy.toml b/clippy.toml index 829dd1c59..62ca74234 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.51" +msrv = "1.56" From e43a114b19b4b59dd666818d35faef1b8ea776f4 Mon Sep 17 00:00:00 2001 From: Dec Warner Date: Fri, 10 Jun 2022 12:45:46 +0100 Subject: [PATCH 2/4] cargo fix --edition --- src/assets.rs | 4 ++-- src/cgi.rs | 6 +++--- src/content_encoding.rs | 16 ++++++++-------- src/input/accept.rs | 2 +- src/input/basic_http_auth.rs | 4 ++-- src/input/cookies.rs | 4 ++-- src/input/json.rs | 2 +- src/input/multipart.rs | 4 ++-- src/input/plain.rs | 4 ++-- src/input/post.rs | 8 ++++---- src/lib.rs | 10 +++++----- src/log.rs | 4 ++-- src/proxy.rs | 6 +++--- src/response.rs | 6 +++--- src/router.rs | 2 +- src/session.rs | 6 +++--- src/websocket/mod.rs | 4 ++-- src/websocket/websocket.rs | 6 +++--- 18 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/assets.rs b/src/assets.rs index 1bda00d40..f62d8ac09 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -13,8 +13,8 @@ use std::path::Path; use filetime; use time; -use Request; -use Response; +use crate::Request; +use crate::Response; /// Searches inside `path` for a file that matches the given request. If a file is found, /// returns a `Response` that would serve this file if returned. If no file is found, a 404 diff --git a/src/cgi.rs b/src/cgi.rs index 705690e9f..d869bc851 100644 --- a/src/cgi.rs +++ b/src/cgi.rs @@ -46,9 +46,9 @@ use std::io::Read; use std::process::Command; use std::process::Stdio; -use Request; -use Response; -use ResponseBody; +use crate::Request; +use crate::Response; +use crate::ResponseBody; /// Error that can happen when parsing the JSON input. #[derive(Debug)] diff --git a/src/content_encoding.rs b/src/content_encoding.rs index a3244958e..44a3ba20e 100644 --- a/src/content_encoding.rs +++ b/src/content_encoding.rs @@ -25,9 +25,9 @@ //! content_encoding::apply(&request, response) //! } //! ``` -use input; -use Request; -use Response; +use crate::input; +use crate::Request; +use crate::Response; /// Applies content encoding to the response. /// @@ -110,7 +110,7 @@ fn gzip(response: &mut Response) { use deflate::deflate_bytes_gzip; use std::io; use std::mem; - use ResponseBody; + use crate::ResponseBody; response .headers @@ -134,7 +134,7 @@ fn gzip(response: &mut Response) {} fn brotli(response: &mut Response) { use brotli::enc::reader::CompressorReader; use std::mem; - use ResponseBody; + use crate::ResponseBody; response .headers @@ -151,9 +151,9 @@ fn brotli(response: &mut Response) {} #[cfg(test)] mod tests { - use content_encoding; - use Request; - use Response; + use crate::content_encoding; + use crate::Request; + use crate::Response; // TODO: more tests for encoding stuff #[test] diff --git a/src/input/accept.rs b/src/input/accept.rs index ae8248fdc..4efbcab67 100644 --- a/src/input/accept.rs +++ b/src/input/accept.rs @@ -92,7 +92,7 @@ macro_rules! accept { #[cfg(test)] mod tests { - use Request; + use crate::Request; #[test] fn basic() { diff --git a/src/input/basic_http_auth.rs b/src/input/basic_http_auth.rs index 4244ef22d..3f9943779 100644 --- a/src/input/basic_http_auth.rs +++ b/src/input/basic_http_auth.rs @@ -18,7 +18,7 @@ //! [the `plain_text_body` function](fn.plain_text_body.html). use base64; -use Request; +use crate::Request; /// Credentials returned by `basic_http_auth`. #[derive(Debug, Clone, PartialEq, Eq)] @@ -104,7 +104,7 @@ pub fn basic_http_auth(request: &Request) -> Option { mod test { use super::basic_http_auth; use super::HttpAuthCredentials; - use Request; + use crate::Request; #[test] fn basic_http_auth_no_header() { diff --git a/src/input/cookies.rs b/src/input/cookies.rs index 7752ea336..29b011cd0 100644 --- a/src/input/cookies.rs +++ b/src/input/cookies.rs @@ -18,7 +18,7 @@ //! [the `plain_text_body` function](fn.plain_text_body.html). use std::str::Split; -use Request; +use crate::Request; /// Attempts to parse the list of cookies from the request. /// @@ -90,7 +90,7 @@ impl<'a> Iterator for CookiesIter<'a> { #[cfg(test)] mod test { use super::cookies; - use Request; + use crate::Request; #[test] fn no_cookie() { diff --git a/src/input/json.rs b/src/input/json.rs index 12e146ede..c1a1936c6 100644 --- a/src/input/json.rs +++ b/src/input/json.rs @@ -39,7 +39,7 @@ use serde_json; use std::error; use std::fmt; use std::io::Error as IoError; -use Request; +use crate::Request; /// Error that can happen when parsing the JSON input. #[derive(Debug)] diff --git a/src/input/multipart.rs b/src/input/multipart.rs index b15bba188..eba29d16f 100644 --- a/src/input/multipart.rs +++ b/src/input/multipart.rs @@ -15,8 +15,8 @@ use std::error; use std::fmt; -use Request; -use RequestBody; +use crate::Request; +use crate::RequestBody; use multipart::server::Multipart as InnerMultipart; diff --git a/src/input/plain.rs b/src/input/plain.rs index adf3d02af..85ee9e238 100644 --- a/src/input/plain.rs +++ b/src/input/plain.rs @@ -11,7 +11,7 @@ use std::error; use std::fmt; use std::io::Error as IoError; use std::io::Read; -use Request; +use crate::Request; /// Error that can happen when parsing the request body as plain text. #[derive(Debug)] @@ -138,7 +138,7 @@ mod test { use super::plain_text_body; use super::plain_text_body_with_limit; use super::PlainTextError; - use Request; + use crate::Request; #[test] fn ok() { diff --git a/src/input/post.rs b/src/input/post.rs index 1cef19ddb..819ca9f22 100644 --- a/src/input/post.rs +++ b/src/input/post.rs @@ -101,7 +101,7 @@ //! `from_file` method. You should return `PostFieldError::WrongFieldType` if you're //! expecting a file and `from_field` was called, or vice-versa. -use Request; +use crate::Request; use std::borrow::Cow; use std::error; @@ -698,9 +698,9 @@ pub fn raw_urlencoded_post_input(request: &Request) -> Result Read for RequestBody<'a> { #[cfg(test)] mod tests { - use Request; + use crate::Request; #[test] fn header() { diff --git a/src/log.rs b/src/log.rs index a766d4cf5..53c18ee47 100644 --- a/src/log.rs +++ b/src/log.rs @@ -14,8 +14,8 @@ use std::time::Instant; use chrono; -use Request; -use Response; +use crate::Request; +use crate::Response; /// Adds a log entry to the given writer for each request. /// diff --git a/src/proxy.rs b/src/proxy.rs index eb766f364..bbc717cef 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -70,9 +70,9 @@ use std::net::TcpStream; use std::net::ToSocketAddrs; use std::time::Duration; -use Request; -use Response; -use ResponseBody; +use crate::Request; +use crate::Response; +use crate::ResponseBody; /// Error that can happen when dispatching the request to another server. #[derive(Debug)] diff --git a/src/response.rs b/src/response.rs index 4b4338875..623f1dde5 100644 --- a/src/response.rs +++ b/src/response.rs @@ -16,8 +16,8 @@ use std::fs::File; use std::io; use std::io::Cursor; use std::io::Read; -use Request; -use Upgrade; +use crate::Request; +use crate::Upgrade; /// Contains a prototype of a response. /// @@ -867,7 +867,7 @@ impl ResponseBody { #[cfg(test)] mod tests { - use Response; + use crate::Response; #[test] fn unique_header_adds() { diff --git a/src/router.rs b/src/router.rs index f483f5bb7..f25a6d0aa 100644 --- a/src/router.rs +++ b/src/router.rs @@ -352,7 +352,7 @@ macro_rules! router { #[allow(unused_variables)] #[cfg(test)] mod tests { - use Request; + use crate::Request; // -- old-style tests -- #[test] diff --git a/src/session.rs b/src/session.rs index 847b92005..fa70fdc42 100644 --- a/src/session.rs +++ b/src/session.rs @@ -40,9 +40,9 @@ use std::borrow::Cow; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; -use input; -use Request; -use Response; +use crate::input; +use crate::Request; +use crate::Response; pub fn session<'r, F>(request: &'r Request, cookie_name: &str, timeout_s: u64, inner: F) -> Response where diff --git a/src/websocket/mod.rs b/src/websocket/mod.rs index 506ef31b7..e869cf7dc 100644 --- a/src/websocket/mod.rs +++ b/src/websocket/mod.rs @@ -77,8 +77,8 @@ use std::fmt; use std::sync::mpsc; use std::vec::IntoIter as VecIntoIter; -use Request; -use Response; +use crate::Request; +use crate::Response; mod low_level; #[allow(clippy::module_inception)] diff --git a/src/websocket/websocket.rs b/src/websocket/websocket.rs index 51248134c..5cd34dbc5 100644 --- a/src/websocket/websocket.rs +++ b/src/websocket/websocket.rs @@ -11,10 +11,10 @@ use std::io; use std::io::Write; use std::mem; use std::sync::mpsc::Sender; -use ReadWrite; -use Upgrade; +use crate::ReadWrite; +use crate::Upgrade; -use websocket::low_level; +use crate::websocket::low_level; /// A successful websocket. An open channel of communication. Implements `Read` and `Write`. pub struct Websocket { From 0f2c56f92dd38cf0999c8ce9f86b152bf5d9ed1c Mon Sep 17 00:00:00 2001 From: Dec Warner Date: Tue, 14 Jun 2022 12:51:23 +0100 Subject: [PATCH 3/4] run cargo fmt --- src/content_encoding.rs | 4 ++-- src/input/basic_http_auth.rs | 2 +- src/input/cookies.rs | 2 +- src/input/json.rs | 2 +- src/input/plain.rs | 2 +- src/response.rs | 4 ++-- src/websocket/websocket.rs | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/content_encoding.rs b/src/content_encoding.rs index 44a3ba20e..0ddd3518b 100644 --- a/src/content_encoding.rs +++ b/src/content_encoding.rs @@ -107,10 +107,10 @@ fn response_is_text(response: &Response) -> bool { #[cfg(feature = "gzip")] fn gzip(response: &mut Response) { + use crate::ResponseBody; use deflate::deflate_bytes_gzip; use std::io; use std::mem; - use crate::ResponseBody; response .headers @@ -132,9 +132,9 @@ fn gzip(response: &mut Response) {} #[cfg(feature = "brotli")] fn brotli(response: &mut Response) { + use crate::ResponseBody; use brotli::enc::reader::CompressorReader; use std::mem; - use crate::ResponseBody; response .headers diff --git a/src/input/basic_http_auth.rs b/src/input/basic_http_auth.rs index 3f9943779..71ceb98ed 100644 --- a/src/input/basic_http_auth.rs +++ b/src/input/basic_http_auth.rs @@ -17,8 +17,8 @@ //! - In order to read a plain text body, see //! [the `plain_text_body` function](fn.plain_text_body.html). -use base64; use crate::Request; +use base64; /// Credentials returned by `basic_http_auth`. #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/src/input/cookies.rs b/src/input/cookies.rs index 29b011cd0..9fd27c9a9 100644 --- a/src/input/cookies.rs +++ b/src/input/cookies.rs @@ -17,8 +17,8 @@ //! - In order to read a plain text body, see //! [the `plain_text_body` function](fn.plain_text_body.html). -use std::str::Split; use crate::Request; +use std::str::Split; /// Attempts to parse the list of cookies from the request. /// diff --git a/src/input/json.rs b/src/input/json.rs index c1a1936c6..feddc511d 100644 --- a/src/input/json.rs +++ b/src/input/json.rs @@ -34,12 +34,12 @@ //! ``` //! +use crate::Request; use serde; use serde_json; use std::error; use std::fmt; use std::io::Error as IoError; -use crate::Request; /// Error that can happen when parsing the JSON input. #[derive(Debug)] diff --git a/src/input/plain.rs b/src/input/plain.rs index 85ee9e238..82445d216 100644 --- a/src/input/plain.rs +++ b/src/input/plain.rs @@ -7,11 +7,11 @@ // notice may not be copied, modified, or distributed except // according to those terms. +use crate::Request; use std::error; use std::fmt; use std::io::Error as IoError; use std::io::Read; -use crate::Request; /// Error that can happen when parsing the request body as plain text. #[derive(Debug)] diff --git a/src/response.rs b/src/response.rs index 623f1dde5..72ce29ad7 100644 --- a/src/response.rs +++ b/src/response.rs @@ -7,6 +7,8 @@ // notice may not be copied, modified, or distributed except // according to those terms. +use crate::Request; +use crate::Upgrade; use percent_encoding; use serde; use serde_json; @@ -16,8 +18,6 @@ use std::fs::File; use std::io; use std::io::Cursor; use std::io::Read; -use crate::Request; -use crate::Upgrade; /// Contains a prototype of a response. /// diff --git a/src/websocket/websocket.rs b/src/websocket/websocket.rs index 5cd34dbc5..0ba4cf36a 100644 --- a/src/websocket/websocket.rs +++ b/src/websocket/websocket.rs @@ -7,12 +7,12 @@ // notice may not be copied, modified, or distributed except // according to those terms. +use crate::ReadWrite; +use crate::Upgrade; use std::io; use std::io::Write; use std::mem; use std::sync::mpsc::Sender; -use crate::ReadWrite; -use crate::Upgrade; use crate::websocket::low_level; From 485eabd68a9d8e7e11feba6bc51a460fcbb6f7e7 Mon Sep 17 00:00:00 2001 From: Dec Date: Mon, 4 Jul 2022 18:01:17 +0100 Subject: [PATCH 4/4] bump to 1.57 --- .github/workflows/ci.yaml | 2 +- clippy.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 017d870c7..783139252 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,7 @@ jobs: rust: - stable - nightly - - 1.56 + - 1.57 features: - default - ssl diff --git a/clippy.toml b/clippy.toml index 62ca74234..5cccb362c 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.56" +msrv = "1.57"