From bad5f32a687b50bb3889c30173920b147cfa36ef Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 11 Sep 2020 16:26:15 +0100 Subject: [PATCH] update all packages to use actix-web v3 (#94) --- .github/workflows/msrv.yml | 1 - actix-cors/CHANGES.md | 19 +++++++----------- actix-cors/Cargo.toml | 4 ++-- actix-cors/src/lib.rs | 4 ++-- actix-identity/CHANGES.md | 6 +++--- actix-identity/Cargo.toml | 8 ++++---- actix-identity/src/lib.rs | 5 +++-- actix-protobuf/CHANGES.md | 4 ++-- actix-protobuf/Cargo.toml | 6 +++--- .../examples/prost-example/Cargo.toml | 8 ++++---- actix-protobuf/src/lib.rs | 6 ++++-- actix-redis/CHANGES.md | 6 +++--- actix-redis/Cargo.toml | 20 +++++++++++++------ actix-redis/src/lib.rs | 3 +++ actix-session/CHANGES.md | 6 +++--- actix-session/Cargo.toml | 6 +++--- actix-session/src/cookie.rs | 2 +- actix-session/src/lib.rs | 3 +++ actix-web-httpauth/CHANGES.md | 12 ++++------- actix-web-httpauth/Cargo.toml | 6 +++--- actix-web-httpauth/src/lib.rs | 6 +----- actix-web-httpauth/src/middleware.rs | 2 +- 22 files changed, 73 insertions(+), 70 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 6ca6c0708..2e42d1235 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -13,7 +13,6 @@ jobs: fail-fast: false matrix: version: - - 1.40.0 - 1.42.0 name: ${{ matrix.version }} - x86_64-unknown-linux-gnu diff --git a/actix-cors/CHANGES.md b/actix-cors/CHANGES.md index 05dc5da90..f87930f08 100644 --- a/actix-cors/CHANGES.md +++ b/actix-cors/CHANGES.md @@ -1,25 +1,20 @@ # Changes -## [unreleased] - -* Minimum supported Rust version(MSRV) is now 1.40.0. +## Unreleased - 2020-xx-xx +* Update `actix-web` dependency to 3.0.0. +* Minimum supported Rust version(MSRV) is now 1.42.0. * Implement the Debug trait on all public types. -## [0.3.0-alpha.1] - 2020-03-11 - +## 0.3.0-alpha.1 - 2020-03-11 * Minimize `futures-*` dependencies * Update `actix-web` dependency to 3.0.0-alpha.1 -## [0.2.0] - 2019-12-20 - +## 0.2.0 - 2019-12-20 * Release -## [0.2.0-alpha.3] - 2019-12-07 - +## 0.2.0-alpha.3 - 2019-12-07 * Migrate to actix-web 2.0.0 - * Bump `derive_more` crate version to 0.99.0 -## [0.1.0] - 2019-06-15 - +## 0.1.0 - 2019-06-15 * Move cors middleware to separate crate diff --git a/actix-cors/Cargo.toml b/actix-cors/Cargo.toml index 3a7edcd2f..14ddfb6e0 100644 --- a/actix-cors/Cargo.toml +++ b/actix-cors/Cargo.toml @@ -16,10 +16,10 @@ name = "actix_cors" path = "src/lib.rs" [dependencies] -actix-web = { version = "3.0.0-alpha.1", default_features = false } +actix-web = { version = "3.0.0", default_features = false } actix-service = "1.0.1" derive_more = "0.99.2" futures-util = { version = "0.3.4", default-features = false } [dev-dependencies] -actix-rt = "1.0.0" +actix-rt = "1.1.1" diff --git a/actix-cors/src/lib.rs b/actix-cors/src/lib.rs index 7ba6b791e..1426cd616 100644 --- a/actix-cors/src/lib.rs +++ b/actix-cors/src/lib.rs @@ -42,7 +42,7 @@ //! ``` #![allow(clippy::borrow_interior_mutable_const, clippy::type_complexity)] -#![deny(missing_docs, missing_debug_implementations)] +#![deny(missing_docs, missing_debug_implementations, rust_2018_idioms)] use std::collections::HashSet; use std::convert::TryFrom; @@ -695,7 +695,7 @@ where LocalBoxFuture<'static, Result>, >; - fn poll_ready(&mut self, cx: &mut Context) -> Poll> { + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { self.service.poll_ready(cx) } diff --git a/actix-identity/CHANGES.md b/actix-identity/CHANGES.md index 3789f22ba..3d1fc686f 100644 --- a/actix-identity/CHANGES.md +++ b/actix-identity/CHANGES.md @@ -1,8 +1,8 @@ # Changes -## [unreleased] - -* Minimum supported Rust version(MSRV) is now 1.40.0. +## Unreleased - 2020-xx-xx +* Update `actix-web` dependency to 3.0.0. +* Minimum supported Rust version(MSRV) is now 1.42.0. ## [0.3.0-alpha.1] - 2020-03-14 diff --git a/actix-identity/Cargo.toml b/actix-identity/Cargo.toml index cf2c5fe9e..415557651 100644 --- a/actix-identity/Cargo.toml +++ b/actix-identity/Cargo.toml @@ -16,14 +16,14 @@ name = "actix_identity" path = "src/lib.rs" [dependencies] -actix-web = { version = "3.0.0-alpha.1", default-features = false, features = ["secure-cookies"] } -actix-service = "1.0.2" +actix-web = { version = "3.0.0", default-features = false, features = ["secure-cookies"] } +actix-service = "1.0.6" futures-util = { version = "0.3.4", default-features = false } serde = "1.0" serde_json = "1.0" time = { version = "0.2.7", default-features = false, features = ["std"] } [dev-dependencies] -actix-rt = "1.0.0" -actix-http = "2.0.0-alpha.2" +actix-rt = "1.1.1" +actix-http = "2.0.0" bytes = "0.5.3" diff --git a/actix-identity/src/lib.rs b/actix-identity/src/lib.rs index 349ecbdcd..45a3a8f36 100644 --- a/actix-identity/src/lib.rs +++ b/actix-identity/src/lib.rs @@ -48,6 +48,7 @@ //! ``` #![allow(clippy::needless_doctest_main)] +#![deny(rust_2018_idioms)] use std::cell::RefCell; use std::future::Future; @@ -274,7 +275,7 @@ where type Error = Error; type Future = LocalBoxFuture<'static, Result>; - fn poll_ready(&mut self, cx: &mut Context) -> Poll> { + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { self.service.borrow_mut().poll_ready(cx) } @@ -424,7 +425,7 @@ impl CookieIdentityInner { }) } - fn parse(&self, cookie: Cookie) -> Option { + fn parse(&self, cookie: Cookie<'_>) -> Option { let value: CookieValue = serde_json::from_str(cookie.value()).ok()?; let now = SystemTime::now(); if let Some(visit_deadline) = self.visit_deadline { diff --git a/actix-protobuf/CHANGES.md b/actix-protobuf/CHANGES.md index c801b3384..c6dda21c8 100644 --- a/actix-protobuf/CHANGES.md +++ b/actix-protobuf/CHANGES.md @@ -1,7 +1,7 @@ # Changes -## unreleased - +## Unreleased - 2020-xx-xx +* Update `actix-web` dependency to 3.0.0. * Minimum supported Rust version(MSRV) is now 1.42.0 to use `matches!` macro. ## 0.6.0-alpha.1 (2020-07-06) diff --git a/actix-protobuf/Cargo.toml b/actix-protobuf/Cargo.toml index c56e6e5fa..5205a6b48 100644 --- a/actix-protobuf/Cargo.toml +++ b/actix-protobuf/Cargo.toml @@ -16,13 +16,13 @@ name = "actix_protobuf" path = "src/lib.rs" [dependencies] +actix-web = { version = "3.0.0", default_features = false } +actix-rt = "1.1.1" + bytes = "0.5" futures-util = { version = "0.3.5", default-features = false } derive_more = "0.99" -actix-rt = "1" -actix-web = { version = "3.0.0-alpha.3", default_features = false } - prost = "0.6.0" [dev-dependencies] diff --git a/actix-protobuf/examples/prost-example/Cargo.toml b/actix-protobuf/examples/prost-example/Cargo.toml index 207ad39c8..3f20a45cd 100644 --- a/actix-protobuf/examples/prost-example/Cargo.toml +++ b/actix-protobuf/examples/prost-example/Cargo.toml @@ -5,12 +5,12 @@ edition = "2018" authors = ["kingxsp ", "Yuki Okushi "] [dependencies] +actix-web = "3.0.0" +actix-rt = "1" +actix-protobuf = { path = "../../" } + bytes = "0.5" env_logger = "*" prost = "0.6.0" prost-derive = "0.6.0" - -actix-rt = "1" -actix-web = "3.0.0-alpha.3" -actix-protobuf = { path="../../" } diff --git a/actix-protobuf/src/lib.rs b/actix-protobuf/src/lib.rs index b67ae12ca..d6ac6cc4e 100644 --- a/actix-protobuf/src/lib.rs +++ b/actix-protobuf/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(rust_2018_idioms)] + use derive_more::Display; use std::fmt; use std::future::Future; @@ -78,7 +80,7 @@ impl fmt::Debug for ProtoBuf where T: fmt::Debug, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "ProtoBuf: {:?}", self.0) } } @@ -87,7 +89,7 @@ impl fmt::Display for ProtoBuf where T: fmt::Display, { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Display::fmt(&self.0, f) } } diff --git a/actix-redis/CHANGES.md b/actix-redis/CHANGES.md index b00140445..c629fae02 100644 --- a/actix-redis/CHANGES.md +++ b/actix-redis/CHANGES.md @@ -1,8 +1,8 @@ # Changes -## unreleased - -* Minimize `futures` dependency +## Unreleased - 2020-xx-xx +* Update `actix-web` dependency to 3.0.0. +* Minimize `futures` dependency. ## [0.9.0-alpha.2] diff --git a/actix-redis/Cargo.toml b/actix-redis/Cargo.toml index ec2a1682b..4c45b3a6f 100644 --- a/actix-redis/Cargo.toml +++ b/actix-redis/Cargo.toml @@ -21,10 +21,18 @@ path = "src/lib.rs" default = ["web"] # actix-web integration -web = ["actix-http/actors", "actix-service", "actix-web", "actix-session/cookie-session", "rand", "serde", "serde_json"] +web = [ + "actix-http/actors", + "actix-service", + "actix-web", + "actix-session/cookie-session", + "rand", + "serde", + "serde_json" +] [dependencies] -actix = "0.10.0-alpha.3" +actix = "0.10.0" actix-utils = "1.0.3" log = "0.4.6" @@ -32,15 +40,15 @@ backoff = "0.2.1" derive_more = "0.99.2" futures-util = { version = "0.3.5", default-features = false } redis-async = "0.6.1" -actix-rt = "1.0.0" +actix-rt = "1.1.1" time = "0.2.9" tokio = "0.2.6" tokio-util = "0.3.0" # actix-session -actix-web = { version = "3.0.0-alpha.2", default_features = false, optional = true } -actix-http = { version = "2.0.0-alpha.3", optional = true } -actix-service = { version = "1.0.0", optional = true } +actix-web = { version = "3.0.0", default_features = false, optional = true } +actix-http = { version = "2.0.0", optional = true } +actix-service = { version = "1.0.6", optional = true } actix-session = { version = "0.4.0-alpha.1", optional = true } rand = { version = "0.7.0", optional = true } serde = { version = "1.0.101", optional = true } diff --git a/actix-redis/src/lib.rs b/actix-redis/src/lib.rs index af812581c..efa5f9bfa 100644 --- a/actix-redis/src/lib.rs +++ b/actix-redis/src/lib.rs @@ -6,6 +6,9 @@ //! * [Chat on gitter](https://gitter.im/actix/actix) //! * Cargo package: [actix-redis](https://crates.io/crates/actix-redis) //! * Minimum supported Rust version: 1.40.0 or later + +#![deny(rust_2018_idioms)] + mod redis; pub use redis::{Command, RedisActor}; diff --git a/actix-session/CHANGES.md b/actix-session/CHANGES.md index 3a42fc26d..abe76e409 100644 --- a/actix-session/CHANGES.md +++ b/actix-session/CHANGES.md @@ -1,11 +1,11 @@ # Changes -## unreleased +## Unreleased - 2020-xx-xx +* Update `actix-web` dependency to 3.0.0. +* Minimum supported Rust version(MSRV) is now 1.42.0. -* Minimum supported Rust version(MSRV) is now 1.40.0. ## [0.4.0-alpha.1] - 2020-03-14 - * Update the `time` dependency to 0.2.7 * Update the `actix-web` dependency to 3.0.0-alpha.1 * Long lasting auto-prolonged session [#1292] diff --git a/actix-session/Cargo.toml b/actix-session/Cargo.toml index 7faf5c279..677d8fe06 100644 --- a/actix-session/Cargo.toml +++ b/actix-session/Cargo.toml @@ -20,8 +20,8 @@ default = ["cookie-session"] cookie-session = ["actix-web/secure-cookies"] [dependencies] -actix-web = { version = "3.0.0-alpha.1", default_features = false } -actix-service = "1.0.1" +actix-web = { version = "3.0.0", default_features = false } +actix-service = "1.0.6" bytes = "0.5.3" derive_more = "0.99.2" futures-util = { version = "0.3.4", default-features = false } @@ -30,4 +30,4 @@ serde_json = "1.0" time = { version = "0.2.7", default-features = false, features = ["std"] } [dev-dependencies] -actix-rt = "1.0.0" +actix-rt = "1" diff --git a/actix-session/src/cookie.rs b/actix-session/src/cookie.rs index 6fd74317c..32dac0da5 100644 --- a/actix-session/src/cookie.rs +++ b/actix-session/src/cookie.rs @@ -343,7 +343,7 @@ where type Error = S::Error; type Future = LocalBoxFuture<'static, Result>; - fn poll_ready(&mut self, cx: &mut Context) -> Poll> { + fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { self.service.poll_ready(cx) } diff --git a/actix-session/src/lib.rs b/actix-session/src/lib.rs index d363a955c..02dd1a838 100644 --- a/actix-session/src/lib.rs +++ b/actix-session/src/lib.rs @@ -41,6 +41,9 @@ //! .await //! } //! ``` + +#![deny(rust_2018_idioms)] + use std::cell::RefCell; use std::collections::HashMap; use std::rc::Rc; diff --git a/actix-web-httpauth/CHANGES.md b/actix-web-httpauth/CHANGES.md index f01a37ef6..4db3f4785 100644 --- a/actix-web-httpauth/CHANGES.md +++ b/actix-web-httpauth/CHANGES.md @@ -1,13 +1,9 @@ -# Changelog +# Changes -All notable changes to this project will be documented in this file. +## Unreleased - 2020-xx-xx +* Update `actix-web` dependency to 3.0.0. +* Minimum supported Rust version(MSRV) is now 1.42.0. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## unreleased (for alpha version) - -* Minimum supported Rust version(MSRV) is now 1.40.0. ## [0.4.2] - 2020-07-08 - Update the `base64` dependency to 0.12 diff --git a/actix-web-httpauth/Cargo.toml b/actix-web-httpauth/Cargo.toml index 81b0048a2..304d291fd 100644 --- a/actix-web-httpauth/Cargo.toml +++ b/actix-web-httpauth/Cargo.toml @@ -17,14 +17,14 @@ name = "actix_web_httpauth" path = "src/lib.rs" [dependencies] -actix-web = { version = "^2.0", default_features = false } -actix-service = "1.0" +actix-web = { version = "3.0.0", default_features = false } +actix-service = "1.0.6" futures-util = { version = "0.3", default-features = false } bytes = "0.5" base64 = "0.12" [dev-dependencies] -actix-rt = "1.0" +actix-rt = "1" [features] default = [] diff --git a/actix-web-httpauth/src/lib.rs b/actix-web-httpauth/src/lib.rs index 143cebdef..21994c7be 100644 --- a/actix-web-httpauth/src/lib.rs +++ b/actix-web-httpauth/src/lib.rs @@ -15,11 +15,7 @@ //! [extractors]: https://actix.rs/docs/extractors/ //! [middleware]: ./middleware/ -#![deny(bare_trait_objects)] -#![deny(missing_docs)] -#![deny(nonstandard_style)] -#![deny(rust_2018_idioms)] -#![deny(unused)] +#![deny(bare_trait_objects, missing_docs, nonstandard_style, rust_2018_idioms)] #![deny(clippy::all)] pub mod extractors; diff --git a/actix-web-httpauth/src/middleware.rs b/actix-web-httpauth/src/middleware.rs index 48a9c4dba..d0db6ea5c 100644 --- a/actix-web-httpauth/src/middleware.rs +++ b/actix-web-httpauth/src/middleware.rs @@ -107,7 +107,7 @@ where /// Ok(req) /// } else { /// let config = req.app_data::() - /// .map(|data| data.get_ref().clone()) + /// .map(|data| data.clone()) /// .unwrap_or_else(Default::default) /// .scope("urn:example:channel=HBO&urn:example:rating=G,PG-13"); ///