Merge branch 'master' into files/fix/percent-encoding

This commit is contained in:
Rob Ede 2021-12-29 10:36:10 +00:00 committed by GitHub
commit c47df2ad12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 116 additions and 92 deletions

View File

@ -16,7 +16,7 @@ jobs:
- { name: macOS, os: macos-latest, triple: x86_64-apple-darwin }
- { name: Windows, os: windows-2022, triple: x86_64-pc-windows-msvc }
version:
- 1.52.0 # MSRV
- 1.54.0 # MSRV
- stable
- nightly

View File

@ -3,6 +3,18 @@
## Unreleased - 2021-xx-xx
## 4.0.0-beta.18 - 2021-12-29
### Changed
- Update `cookie` dependency (re-exported) to `0.16`. [#2555]
- Minimum supported Rust version (MSRV) is now 1.54.
### Security
- `cookie` upgrade addresses [`RUSTSEC-2020-0071`].
[#2555]: https://github.com/actix/actix-web/pull/2555
[`RUSTSEC-2020-0071`]: https://rustsec.org/advisories/RUSTSEC-2020-0071.html
## 4.0.0-beta.17 - 2021-12-29
### Added
- `guard::GuardContext` for use with the `Guard` trait. [#2552]

View File

@ -1,6 +1,6 @@
[package]
name = "actix-web"
version = "4.0.0-beta.17"
version = "4.0.0-beta.18"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust"
keywords = ["actix", "http", "web", "framework", "async"]
@ -84,7 +84,7 @@ actix-web-codegen = "0.5.0-beta.6"
ahash = "0.7"
bytes = "1"
cfg-if = "1"
cookie = { version = "0.15", features = ["percent-encode"], optional = true }
cookie = { version = "0.16", features = ["percent-encode"], optional = true }
derive_more = "0.99.5"
encoding_rs = "0.8"
futures-core = { version = "0.3.7", default-features = false }
@ -94,7 +94,6 @@ language-tags = "0.3"
once_cell = "1.5"
log = "0.4"
mime = "0.3"
paste = "1"
pin-project-lite = "0.2.7"
regex = "1.4"
serde = { version = "1.0", features = ["derive"] }
@ -107,7 +106,7 @@ url = "2.1"
[dev-dependencies]
actix-test = { version = "0.1.0-beta.10", features = ["openssl", "rustls"] }
awc = { version = "3.0.0-beta.16", features = ["openssl"] }
awc = { version = "3.0.0-beta.17", features = ["openssl"] }
brotli2 = "0.3.2"
criterion = { version = "0.3", features = ["html_reports"] }

View File

@ -6,10 +6,10 @@
<p>
[![crates.io](https://img.shields.io/crates/v/actix-web?label=latest)](https://crates.io/crates/actix-web)
[![Documentation](https://docs.rs/actix-web/badge.svg?version=4.0.0-beta.17)](https://docs.rs/actix-web/4.0.0-beta.17)
[![Version](https://img.shields.io/badge/rustc-1.52+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
[![Documentation](https://docs.rs/actix-web/badge.svg?version=4.0.0-beta.18)](https://docs.rs/actix-web/4.0.0-beta.18)
[![Version](https://img.shields.io/badge/rustc-1.54+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.54.0.html)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-web.svg)
[![Dependency Status](https://deps.rs/crate/actix-web/4.0.0-beta.17/status.svg)](https://deps.rs/crate/actix-web/4.0.0-beta.17)
[![Dependency Status](https://deps.rs/crate/actix-web/4.0.0-beta.18/status.svg)](https://deps.rs/crate/actix-web/4.0.0-beta.18)
<br />
[![build status](https://github.com/actix/actix-web/workflows/CI%20%28Linux%29/badge.svg?branch=master&event=push)](https://github.com/actix/actix-web/actions)
[![codecov](https://codecov.io/gh/actix/actix-web/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-web)
@ -32,7 +32,7 @@
- SSL support using OpenSSL or Rustls
- Middlewares ([Logger, Session, CORS, etc](https://actix.rs/docs/middleware/))
- Includes an async [HTTP client](https://docs.rs/awc/)
- Runs on stable Rust 1.52+
- Runs on stable Rust 1.54+
## Documentation

View File

@ -1,14 +1,15 @@
# Changes
## Unreleased - 2021-xx-xx
- Minimum supported Rust version (MSRV) is now 1.54.
## 0.6.0-beta.12 - 2021-12-29
* No significant changes since `0.6.0-beta.11`.
- No significant changes since `0.6.0-beta.11`.
## 0.6.0-beta.11 - 2021-12-27
* No significant changes since `0.6.0-beta.10`.
- No significant changes since `0.6.0-beta.10`.
## 0.6.0-beta.10 - 2021-12-11

View File

@ -25,7 +25,7 @@ experimental-io-uring = ["actix-web/experimental-io-uring", "tokio-uring"]
actix-http = "3.0.0-beta.17"
actix-service = "2"
actix-utils = "3"
actix-web = { version = "4.0.0-beta.17", default-features = false }
actix-web = { version = "4.0.0-beta.18", default-features = false }
askama_escape = "0.10"
bitflags = "1"
@ -44,5 +44,5 @@ tokio-uring = { version = "0.1", optional = true }
[dev-dependencies]
actix-rt = "2.2"
actix-test = "0.1.0-beta.10"
actix-web = "4.0.0-beta.17"
actix-web = "4.0.0-beta.18"
tempfile = "3.2"

View File

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-files?label=latest)](https://crates.io/crates/actix-files)
[![Documentation](https://docs.rs/actix-files/badge.svg?version=0.6.0-beta.12)](https://docs.rs/actix-files/0.6.0-beta.12)
[![Version](https://img.shields.io/badge/rustc-1.52+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
[![Version](https://img.shields.io/badge/rustc-1.54+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.54.0.html)
![License](https://img.shields.io/crates/l/actix-files.svg)
<br />
[![dependency status](https://deps.rs/crate/actix-files/0.6.0-beta.12/status.svg)](https://deps.rs/crate/actix-files/0.6.0-beta.12)
@ -15,4 +15,4 @@
- [API Documentation](https://docs.rs/actix-files/)
- [Example Project](https://github.com/actix/examples/tree/master/basics/static_index)
- Minimum Supported Rust Version (MSRV): 1.52
- Minimum Supported Rust Version (MSRV): 1.54

View File

@ -1,6 +1,7 @@
# Changes
## Unreleased - 2021-xx-xx
- Minimum supported Rust version (MSRV) is now 1.54.
## 3.0.0-beta.10 - 2021-12-27

View File

@ -35,7 +35,7 @@ actix-tls = "3.0.0"
actix-utils = "3.0.0"
actix-rt = "2.2"
actix-server = "2.0.0-rc.2"
awc = { version = "3.0.0-beta.16", default-features = false }
awc = { version = "3.0.0-beta.17", default-features = false }
base64 = "0.13"
bytes = "1"
@ -51,5 +51,5 @@ tls-openssl = { version = "0.10.9", package = "openssl", optional = true }
tokio = { version = "1.8.4", features = ["sync"] }
[dev-dependencies]
actix-web = { version = "4.0.0-beta.17", default-features = false, features = ["cookies"] }
actix-web = { version = "4.0.0-beta.18", default-features = false, features = ["cookies"] }
actix-http = "3.0.0-beta.17"

View File

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-http-test?label=latest)](https://crates.io/crates/actix-http-test)
[![Documentation](https://docs.rs/actix-http-test/badge.svg?version=3.0.0-beta.10)](https://docs.rs/actix-http-test/3.0.0-beta.10)
[![Version](https://img.shields.io/badge/rustc-1.52+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
[![Version](https://img.shields.io/badge/rustc-1.54+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.54.0.html)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-http-test)
<br>
[![Dependency Status](https://deps.rs/crate/actix-http-test/3.0.0-beta.10/status.svg)](https://deps.rs/crate/actix-http-test/3.0.0-beta.10)
@ -14,4 +14,4 @@
## Documentation & Resources
- [API Documentation](https://docs.rs/actix-http-test)
- Minimum Supported Rust Version (MSRV): 1.52
- Minimum Supported Rust Version (MSRV): 1.54

View File

@ -1,6 +1,7 @@
# Changes
## Unreleased - 2021-xx-xx
- Minimum supported Rust version (MSRV) is now 1.54.
## 3.0.0-beta.17 - 2021-12-27

View File

@ -82,7 +82,7 @@ zstd = { version = "0.9", optional = true }
actix-http-test = { version = "3.0.0-beta.10", features = ["openssl"] }
actix-server = "2.0.0-rc.2"
actix-tls = { version = "3.0.0", features = ["openssl"] }
actix-web = "4.0.0-beta.17"
actix-web = "4.0.0-beta.18"
async-stream = "0.3"
criterion = { version = "0.3", features = ["html_reports"] }

View File

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-http?label=latest)](https://crates.io/crates/actix-http)
[![Documentation](https://docs.rs/actix-http/badge.svg?version=3.0.0-beta.17)](https://docs.rs/actix-http/3.0.0-beta.17)
[![Version](https://img.shields.io/badge/rustc-1.52+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
[![Version](https://img.shields.io/badge/rustc-1.54+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.54.0.html)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-http.svg)
<br />
[![dependency status](https://deps.rs/crate/actix-http/3.0.0-beta.17/status.svg)](https://deps.rs/crate/actix-http/3.0.0-beta.17)
@ -14,7 +14,7 @@
## Documentation & Resources
- [API Documentation](https://docs.rs/actix-http)
- Minimum Supported Rust Version (MSRV): 1.52
- Minimum Supported Rust Version (MSRV): 1.54
## Example

View File

@ -1,10 +1,11 @@
# Changes
## Unreleased - 2021-xx-xx
- Minimum supported Rust version (MSRV) is now 1.54.
## 0.4.0-beta.11 - 2021-12-27
* No significant changes since `0.4.0-beta.10`.
- No significant changes since `0.4.0-beta.10`.
## 0.4.0-beta.10 - 2021-12-11

View File

@ -15,7 +15,7 @@ path = "src/lib.rs"
[dependencies]
actix-utils = "3.0.0"
actix-web = { version = "4.0.0-beta.17", default-features = false }
actix-web = { version = "4.0.0-beta.18", default-features = false }
bytes = "1"
derive_more = "0.99.5"

View File

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-multipart?label=latest)](https://crates.io/crates/actix-multipart)
[![Documentation](https://docs.rs/actix-multipart/badge.svg?version=0.4.0-beta.11)](https://docs.rs/actix-multipart/0.4.0-beta.11)
[![Version](https://img.shields.io/badge/rustc-1.52+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
[![Version](https://img.shields.io/badge/rustc-1.54+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.54.0.html)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-multipart.svg)
<br />
[![dependency status](https://deps.rs/crate/actix-multipart/0.4.0-beta.11/status.svg)](https://deps.rs/crate/actix-multipart/0.4.0-beta.11)
@ -14,4 +14,4 @@
## Documentation & Resources
- [API Documentation](https://docs.rs/actix-multipart)
- Minimum Supported Rust Version (MSRV): 1.52
- Minimum Supported Rust Version (MSRV): 1.54

View File

@ -1,6 +1,7 @@
# Changes
## Unreleased - 2021-xx-xx
- Minimum supported Rust version (MSRV) is now 1.54.
## 0.5.0-beta.3 - 2021-12-17

View File

@ -1,10 +1,11 @@
# Changes
## Unreleased - 2021-xx-xx
- Minimum supported Rust version (MSRV) is now 1.54.
## 0.1.0-beta.10 - 2021-12-27
* No significant changes since `0.1.0-beta.9`.
- No significant changes since `0.1.0-beta.9`.
## 0.1.0-beta.9 - 2021-12-17

View File

@ -34,8 +34,8 @@ actix-http-test = "3.0.0-beta.10"
actix-rt = "2.1"
actix-service = "2.0.0"
actix-utils = "3.0.0"
actix-web = { version = "4.0.0-beta.17", default-features = false, features = ["cookies"] }
awc = { version = "3.0.0-beta.16", default-features = false, features = ["cookies"] }
actix-web = { version = "4.0.0-beta.18", default-features = false, features = ["cookies"] }
awc = { version = "3.0.0-beta.17", default-features = false, features = ["cookies"] }
futures-core = { version = "0.3.7", default-features = false, features = ["std"] }
futures-util = { version = "0.3.7", default-features = false, features = [] }

View File

@ -1,10 +1,11 @@
# Changes
## Unreleased - 2021-xx-xx
- Minimum supported Rust version (MSRV) is now 1.54.
## 4.0.0-beta.9 - 2021-12-27
* No significant changes since `4.0.0-beta.8`.
- No significant changes since `4.0.0-beta.8`.
## 4.0.0-beta.8 - 2021-12-11

View File

@ -17,7 +17,7 @@ path = "src/lib.rs"
actix = { version = "0.12.0", default-features = false }
actix-codec = "0.4.1"
actix-http = "3.0.0-beta.17"
actix-web = { version = "4.0.0-beta.17", default-features = false }
actix-web = { version = "4.0.0-beta.18", default-features = false }
bytes = "1"
bytestring = "1"
@ -28,7 +28,7 @@ tokio = { version = "1.8.4", features = ["sync"] }
[dev-dependencies]
actix-rt = "2.2"
actix-test = "0.1.0-beta.10"
awc = { version = "3.0.0-beta.16", default-features = false }
awc = { version = "3.0.0-beta.17", default-features = false }
env_logger = "0.9"
futures-util = { version = "0.3.7", default-features = false }

View File

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-web-actors?label=latest)](https://crates.io/crates/actix-web-actors)
[![Documentation](https://docs.rs/actix-web-actors/badge.svg?version=4.0.0-beta.9)](https://docs.rs/actix-web-actors/4.0.0-beta.9)
[![Version](https://img.shields.io/badge/rustc-1.52+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
[![Version](https://img.shields.io/badge/rustc-1.54+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.54.0.html)
![License](https://img.shields.io/crates/l/actix-web-actors.svg)
<br />
[![dependency status](https://deps.rs/crate/actix-web-actors/4.0.0-beta.9/status.svg)](https://deps.rs/crate/actix-web-actors/4.0.0-beta.9)
@ -14,4 +14,4 @@
## Documentation & Resources
- [API Documentation](https://docs.rs/actix-web-actors)
- Minimum Supported Rust Version (MSRV): 1.52
- Minimum Supported Rust Version (MSRV): 1.54

View File

@ -1,6 +1,7 @@
# Changes
## Unreleased - 2021-xx-xx
- Minimum supported Rust version (MSRV) is now 1.54.
## 0.5.0-beta.6 - 2021-12-11

View File

@ -25,7 +25,7 @@ actix-macros = "0.2.3"
actix-rt = "2.2"
actix-test = "0.1.0-beta.10"
actix-utils = "3.0.0"
actix-web = "4.0.0-beta.17"
actix-web = "4.0.0-beta.18"
futures-core = { version = "0.3.7", default-features = false, features = ["alloc"] }
trybuild = "1"

View File

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-web-codegen?label=latest)](https://crates.io/crates/actix-web-codegen)
[![Documentation](https://docs.rs/actix-web-codegen/badge.svg?version=0.5.0-beta.6)](https://docs.rs/actix-web-codegen/0.5.0-beta.6)
[![Version](https://img.shields.io/badge/rustc-1.52+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.52.0.html)
[![Version](https://img.shields.io/badge/rustc-1.54+-ab6000.svg)](https://blog.rust-lang.org/2021/05/06/Rust-1.54.0.html)
![License](https://img.shields.io/crates/l/actix-web-codegen.svg)
<br />
[![dependency status](https://deps.rs/crate/actix-web-codegen/0.5.0-beta.6/status.svg)](https://deps.rs/crate/actix-web-codegen/0.5.0-beta.6)
@ -14,7 +14,7 @@
## Documentation & Resources
- [API Documentation](https://docs.rs/actix-web-codegen)
- Minimum Supported Rust Version (MSRV): 1.52
- Minimum Supported Rust Version (MSRV): 1.54
## Compile Testing

View File

@ -1,4 +1,4 @@
#[rustversion::stable(1.52)] // MSRV
#[rustversion::stable(1.54)] // MSRV
#[test]
fn compile_macros() {
let t = trybuild::TestCases::new();

View File

@ -1,13 +1,13 @@
error: The #[route(..)] macro requires at least one `method` attribute
--> $DIR/route-missing-method-fail.rs:3:1
--> tests/trybuild/route-missing-method-fail.rs:3:1
|
3 | #[route("/")]
| ^^^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the attribute macro `route` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `fn() -> impl std::future::Future {index}: HttpServiceFactory` is not satisfied
--> $DIR/route-missing-method-fail.rs:12:55
--> tests/trybuild/route-missing-method-fail.rs:12:55
|
12 | let srv = actix_test::start(|| App::new().service(index));
| ^^^^^ the trait `HttpServiceFactory` is not implemented for `fn() -> impl std::future::Future {index}`

View File

@ -3,6 +3,17 @@
## Unreleased - 2021-xx-xx
## 3.0.0-beta.17 - 2021-12-29
### Changed
- Update `cookie` dependency (re-exported) to `0.16`. [#2555]
### Security
- `cookie` upgrade addresses [`RUSTSEC-2020-0071`].
[#2555]: https://github.com/actix/actix-web/pull/2555
[`RUSTSEC-2020-0071`]: https://rustsec.org/advisories/RUSTSEC-2020-0071.html
## 3.0.0-beta.16 - 2021-12-29
- `*::send_json` and `*::send_form` methods now receive `impl Serialize`. [#2553]
- `FrozenClientRequest::extra_header` now uses receives an `impl TryIntoHeaderPair`. [#2553]

View File

@ -1,6 +1,6 @@
[package]
name = "awc"
version = "3.0.0-beta.16"
version = "3.0.0-beta.17"
authors = [
"Nikolay Kim <fafhrd91@gmail.com>",
"fakeshadow <24548779@qq.com>",
@ -85,7 +85,7 @@ serde_json = "1.0"
serde_urlencoded = "0.7"
tokio = { version = "1.8.4", features = ["sync"] }
cookie = { version = "0.15", features = ["percent-encode"], optional = true }
cookie = { version = "0.16", features = ["percent-encode"], optional = true }
tls-openssl = { package = "openssl", version = "0.10.9", optional = true }
tls-rustls = { package = "rustls", version = "0.20.0", optional = true, features = ["dangerous_configuration"] }
@ -99,7 +99,7 @@ actix-server = "2.0.0-rc.2"
actix-test = { version = "0.1.0-beta.10", features = ["openssl", "rustls"] }
actix-tls = { version = "3.0.0", features = ["openssl", "rustls"] }
actix-utils = "3.0.0"
actix-web = { version = "4.0.0-beta.17", features = ["openssl"] }
actix-web = { version = "4.0.0-beta.18", features = ["openssl"] }
brotli2 = "0.3.2"
env_logger = "0.9"

View File

@ -3,16 +3,16 @@
> Async HTTP and WebSocket client library.
[![crates.io](https://img.shields.io/crates/v/awc?label=latest)](https://crates.io/crates/awc)
[![Documentation](https://docs.rs/awc/badge.svg?version=3.0.0-beta.16)](https://docs.rs/awc/3.0.0-beta.16)
[![Documentation](https://docs.rs/awc/badge.svg?version=3.0.0-beta.17)](https://docs.rs/awc/3.0.0-beta.17)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/awc)
[![Dependency Status](https://deps.rs/crate/awc/3.0.0-beta.16/status.svg)](https://deps.rs/crate/awc/3.0.0-beta.16)
[![Dependency Status](https://deps.rs/crate/awc/3.0.0-beta.17/status.svg)](https://deps.rs/crate/awc/3.0.0-beta.17)
[![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)
## Documentation & Resources
- [API Documentation](https://docs.rs/awc)
- [Example Project](https://github.com/actix/examples/tree/HEAD/security/awc_https)
- Minimum Supported Rust Version (MSRV): 1.52
- Minimum Supported Rust Version (MSRV): 1.54
## Example

View File

@ -1 +1 @@
msrv = "1.52"
msrv = "1.54"

View File

@ -40,7 +40,7 @@ cat "$CHANGELOG_FILE" |
# if word count of changelog chunk is 0 then insert filler changelog chunk
if [ "$(wc -w "$CHANGE_CHUNK_FILE" | awk '{ print $1 }')" = "0" ]; then
echo "* No significant changes since \`$CURRENT_VERSION\`." >"$CHANGE_CHUNK_FILE"
echo "- No significant changes since \`$CURRENT_VERSION\`." >"$CHANGE_CHUNK_FILE"
echo >>"$CHANGE_CHUNK_FILE"
echo >>"$CHANGE_CHUNK_FILE"
fi

View File

@ -118,8 +118,7 @@ where
macro_rules! error_helper {
($name:ident, $status:ident) => {
paste::paste! {
#[doc = "Helper function that wraps any error and generates a `" $status "` response."]
#[doc = concat!("Helper function that wraps any error and generates a `", stringify!($status), "` response.")]
#[allow(non_snake_case)]
pub fn $name<T>(err: T) -> Error
where
@ -127,7 +126,6 @@ macro_rules! error_helper {
{
InternalError::new(err, StatusCode::$status).into()
}
}
};
}

View File

@ -270,23 +270,21 @@ impl Guard for MethodGuard {
macro_rules! method_guard {
($method_fn:ident, $method_const:ident) => {
paste::paste! {
#[doc = " Creates a guard that matches the `" $method_const "` request method."]
#[doc = concat!("Creates a guard that matches the `", stringify!($method_const), "` request method.")]
///
/// # Examples
#[doc = " The route in this example will only respond to `" $method_const "` requests."]
#[doc = concat!("The route in this example will only respond to `", stringify!($method_const), "` requests.")]
/// ```
/// use actix_web::{guard, web, HttpResponse};
///
/// web::route()
#[doc = " .guard(guard::" $method_fn "())"]
#[doc = concat!(" .guard(guard::", stringify!($method_fn), "())")]
/// .to(|| HttpResponse::Ok());
/// ```
#[allow(non_snake_case)]
pub fn $method_fn() -> impl Guard {
MethodGuard(HttpMethod::$method_const)
}
}
};
}

View File

@ -53,7 +53,7 @@
//! * SSL support using OpenSSL or Rustls
//! * Middlewares ([Logger, Session, CORS, etc](https://actix.rs/docs/middleware/))
//! * Includes an async [HTTP client](https://docs.rs/awc/)
//! * Runs on stable Rust 1.52+
//! * Runs on stable Rust 1.54+
//!
//! # Crate Features
//! * `cookies` - cookies support (enabled by default)

View File

@ -86,24 +86,22 @@ pub fn route() -> Route {
macro_rules! method_route {
($method_fn:ident, $method_const:ident) => {
paste::paste! {
#[doc = " Creates a new route with `" $method_const "` method guard."]
#[doc = concat!(" Creates a new route with `", stringify!($method_const), "` method guard.")]
///
/// # Examples
#[doc = " In this example, one `" $method_const " /{project_id}` route is set up:"]
#[doc = concat!(" In this example, one `", stringify!($method_const), " /{project_id}` route is set up:")]
/// ```
/// use actix_web::{web, App, HttpResponse};
///
/// let app = App::new().service(
/// web::resource("/{project_id}")
#[doc = " .route(web::" $method_fn "().to(|| HttpResponse::Ok()))"]
#[doc = concat!(" .route(web::", stringify!($method_fn), "().to(|| HttpResponse::Ok()))")]
///
/// );
/// ```
pub fn $method_fn() -> Route {
method(Method::$method_const)
}
}
};
}