mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-06 00:00:17 +02:00
Remove RequestParts::take_extensions (#699)
* Remove `RequestParts::take_extensions` * fix out of date docs * Remove RequestAlreadyExtracted and replace it with BodyAlreadyExtracted * fix docs * fix test * Update axum-core/src/extract/mod.rs Co-authored-by: Jonas Platte <[email protected]> * Remove macro only used once Co-authored-by: Jonas Platte <[email protected]>
This commit is contained in:
co-authored by
Jonas Platte
parent
184ea656c0
commit
b1ef0be1a7
@@ -1,39 +1,4 @@
|
||||
macro_rules! define_rejection {
|
||||
(
|
||||
#[status = $status:ident]
|
||||
#[body = $body:expr]
|
||||
$(#[$m:meta])*
|
||||
pub struct $name:ident;
|
||||
) => {
|
||||
$(#[$m])*
|
||||
#[derive(Debug)]
|
||||
#[non_exhaustive]
|
||||
pub struct $name;
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl $crate::response::IntoResponse for $name {
|
||||
fn into_response(self) -> $crate::response::Response {
|
||||
let mut res = http::Response::new($crate::body::boxed(http_body::Full::from($body)));
|
||||
*res.status_mut() = http::StatusCode::$status;
|
||||
res
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for $name {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}", $body)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for $name {}
|
||||
|
||||
impl Default for $name {
|
||||
fn default() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
(
|
||||
#[status = $status:ident]
|
||||
#[body = $body:expr]
|
||||
|
||||
Reference in New Issue
Block a user