Skip to content

Commit 3525a13

Browse files
authored
Revert "Make status a const function in rejection handling" (#3287)
1 parent 2b6ae09 commit 3525a13

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

axum-core/CHANGELOG.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
# 0.5.1
99

10-
- **change:** Make the `status` function for rejections generated by the
11-
`__define_rejection` and `__composite_rejection` macros a `const` function
12-
([#3168])
10+
Yanked from crates.io due to unforeseen breaking change, see [#3190] for details.
1311

14-
[#3168]: https://github.com/tokio-rs/axum/pull/3168
12+
[#3190]: https://github.com/tokio-rs/axum/pull/3190
1513

1614
# 0.5.0
1715

axum-core/src/macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ macro_rules! __define_rejection {
5454
}
5555

5656
/// Get the status code used for this rejection.
57-
pub const fn status(&self) -> http::StatusCode {
57+
pub fn status(&self) -> http::StatusCode {
5858
http::StatusCode::$status
5959
}
6060
}
@@ -111,7 +111,7 @@ macro_rules! __define_rejection {
111111
}
112112

113113
/// Get the status code used for this rejection.
114-
pub const fn status(&self) -> http::StatusCode {
114+
pub fn status(&self) -> http::StatusCode {
115115
http::StatusCode::$status
116116
}
117117
}
@@ -188,7 +188,7 @@ macro_rules! __composite_rejection {
188188
}
189189

190190
/// Get the status code used for this rejection.
191-
pub const fn status(&self) -> http::StatusCode {
191+
pub fn status(&self) -> http::StatusCode {
192192
match self {
193193
$(
194194
Self::$variant(inner) => inner.status(),

axum-extra/CHANGELOG.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog],
66
and this project adheres to [Semantic Versioning].
77

8-
# 0.11.0
8+
# Unreleased
99

1010
- **breaking:** Remove unused `async-stream` feature, which was accidentally
1111
introduced as an implicit feature through an optional dependency which was no
1212
longer being used ([#3145])
1313
- **fixed:** Fix a broken link in the documentation of `ErasedJson` ([#3186])
14-
- **changed:** Make the `status` function of rejections a `const` function, such
15-
as `FormRejection`, `QueryRejection` and `MultipartRejection` ([#3168])
1614

1715
[#3145]: https://github.com/tokio-rs/axum/pull/3145
18-
[#3168]: https://github.com/tokio-rs/axum/pull/3168
1916
[#3186]: https://github.com/tokio-rs/axum/pull/3186
2017

18+
# 0.11.0
19+
20+
Yanked from crates.io due to unforeseen breaking change, see [#3190] for details.
21+
22+
[#3190]: https://github.com/tokio-rs/axum/pull/3190
23+
2124
# 0.10.0
2225

2326
## since rc.1

axum/CHANGELOG.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
# Unreleased
99

1010
- **added:** Implement `From<Bytes>` for `Message` ([#3273])
11+
- **added:** Implement `OptionalFromRequest` for `Json` ([#3142])
12+
- **added:** Implement `OptionalFromRequest` for `Extension` ([#3157])
1113
- **changed:** Improved code size / compile time of `Handler` implementations ([#3285])
1214

1315
[#3273]: https://github.com/tokio-rs/axum/pull/3273
16+
[#3142]: https://github.com/tokio-rs/axum/pull/3142
17+
[#3157]: https://github.com/tokio-rs/axum/pull/3157
1418
[#3285]: https://github.com/tokio-rs/axum/pull/3285
1519

1620
# 0.8.2
1721

18-
- **added:** Implement `OptionalFromRequest` for `Json` ([#3142])
19-
- **added:** Implement `OptionalFromRequest` for `Extension` ([#3157])
20-
- **changed:** Make the `status` function of rejections a `const` function, such
21-
as `JsonRejection`, `QueryRejection` and `PathRejection` ([#3168])
22+
Yanked from crates.io due to unforeseen breaking change, see [#3190] for details.
2223

23-
[#3142]: https://github.com/tokio-rs/axum/pull/3142
24-
[#3157]: https://github.com/tokio-rs/axum/pull/3157
25-
[#3168]: https://github.com/tokio-rs/axum/pull/3168
24+
[#3190]: https://github.com/tokio-rs/axum/pull/3190
2625

2726
# 0.8.1
2827

axum/src/extract/path/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl FailedToDeserializePathParams {
429429
}
430430

431431
/// Get the status code used for this rejection.
432-
pub const fn status(&self) -> StatusCode {
432+
pub fn status(&self) -> StatusCode {
433433
match self.0.kind {
434434
ErrorKind::Message(_)
435435
| ErrorKind::DeserializeError { .. }
@@ -563,7 +563,7 @@ impl InvalidUtf8InPathParam {
563563
}
564564

565565
/// Get the status code used for this rejection.
566-
pub const fn status(&self) -> StatusCode {
566+
pub fn status(&self) -> StatusCode {
567567
StatusCode::BAD_REQUEST
568568
}
569569
}

0 commit comments

Comments
 (0)