Remove deprecated APIs (#800)

* Remove deprecations APIs

* changelog
This commit is contained in:
David Pedersen 2022-03-01 00:22:21 +01:00 committed by GitHub
parent f12ab072c5
commit 0d05b5e31f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 27 deletions

View file

@ -54,7 +54,7 @@ macro_rules! composite_rejection {
#[non_exhaustive] #[non_exhaustive]
pub enum $name { pub enum $name {
$( $(
#[allow(missing_docs, deprecated)] #[allow(missing_docs)]
$variant($variant) $variant($variant)
),+ ),+
} }
@ -70,7 +70,6 @@ macro_rules! composite_rejection {
} }
$( $(
#[allow(deprecated)]
impl From<$variant> for $name { impl From<$variant> for $name {
fn from(inner: $variant) -> Self { fn from(inner: $variant) -> Self {
Self::$variant(inner) Self::$variant(inner)

View file

@ -54,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `PathRejection` - `PathRejection`
- `MatchedPathRejection` - `MatchedPathRejection`
- `WebSocketUpgradeRejection` - `WebSocketUpgradeRejection`
- **breaking:** `Redirect::found` has been removed ([#800])
- **fixed:** Set `Allow` header when responding with `405 Method Not Allowed` ([#733]) - **fixed:** Set `Allow` header when responding with `405 Method Not Allowed` ([#733])
- **fixed:** Correctly set the `Content-Length` header for response to `HEAD` - **fixed:** Correctly set the `Content-Length` header for response to `HEAD`
requests ([#734]) requests ([#734])
@ -72,6 +73,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#783]: https://github.com/tokio-rs/axum/pull/783 [#783]: https://github.com/tokio-rs/axum/pull/783
[#791]: https://github.com/tokio-rs/axum/pull/791 [#791]: https://github.com/tokio-rs/axum/pull/791
[#797]: https://github.com/tokio-rs/axum/pull/797 [#797]: https://github.com/tokio-rs/axum/pull/797
[#800]: https://github.com/tokio-rs/axum/pull/800
# 0.4.4 (13. January, 2022) # 0.4.4 (13. January, 2022)

View file

@ -20,7 +20,6 @@ mod request_parts;
pub use axum_core::extract::{FromRequest, RequestParts}; pub use axum_core::extract::{FromRequest, RequestParts};
#[doc(inline)] #[doc(inline)]
#[allow(deprecated)]
pub use self::{ pub use self::{
connect_info::ConnectInfo, connect_info::ConnectInfo,
content_length_limit::ContentLengthLimit, content_length_limit::ContentLengthLimit,

View file

@ -57,7 +57,6 @@ macro_rules! define_rejection {
#[non_exhaustive] #[non_exhaustive]
pub struct $name; pub struct $name;
#[allow(deprecated)]
impl $crate::response::IntoResponse for $name { impl $crate::response::IntoResponse for $name {
fn into_response(self) -> $crate::response::Response { fn into_response(self) -> $crate::response::Response {
(http::StatusCode::$status, $body).into_response() (http::StatusCode::$status, $body).into_response()
@ -134,7 +133,7 @@ macro_rules! composite_rejection {
#[non_exhaustive] #[non_exhaustive]
pub enum $name { pub enum $name {
$( $(
#[allow(missing_docs, deprecated)] #[allow(missing_docs)]
$variant($variant) $variant($variant)
),+ ),+
} }
@ -150,7 +149,6 @@ macro_rules! composite_rejection {
} }
$( $(
#[allow(deprecated)]
impl From<$variant> for $name { impl From<$variant> for $name {
fn from(inner: $variant) -> Self { fn from(inner: $variant) -> Self {
Self::$variant(inner) Self::$variant(inner)

View file

@ -69,27 +69,6 @@ impl Redirect {
Self::with_status_code(StatusCode::PERMANENT_REDIRECT, uri) Self::with_status_code(StatusCode::PERMANENT_REDIRECT, uri)
} }
/// Create a new [`Redirect`] that uses a [`302 Found`][mdn] status code.
///
/// This is the same as [`Redirect::temporary`] ([`307 Temporary Redirect`][mdn307]) except
/// this status code is older and thus supported by some legacy clients that don't understand
/// the newer one. Many clients wrongly apply [`Redirect::to`] ([`303 See Other`][mdn303])
/// semantics for this status code, so it should be avoided where possible.
///
/// # Panics
///
/// If `uri` isn't a valid [`HeaderValue`].
///
/// [mdn]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302
/// [mdn307]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307
/// [mdn303]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303
#[deprecated(
note = "This results in different behavior between clients, so Redirect::temporary or Redirect::to should be used instead"
)]
pub fn found(uri: Uri) -> Self {
Self::with_status_code(StatusCode::FOUND, uri)
}
// This is intentionally not public since other kinds of redirects might not // This is intentionally not public since other kinds of redirects might not
// use the `Location` header, namely `304 Not Modified`. // use the `Location` header, namely `304 Not Modified`.
// //