Remove B type param: Follow ups (#1789)

Co-authored-by: Jonas Platte <[email protected]>
Co-authored-by: Michael Scofield <[email protected]>
This commit is contained in:
David Pedersen
2023-04-21 17:45:31 +02:00
co-authored by Jonas Platte Michael Scofield
parent 72c1b7a80c
commit 6703f8634c
70 changed files with 429 additions and 531 deletions
@@ -1,7 +1,6 @@
use axum::{
async_trait,
extract::FromRequest,
http::Request,
extract::{Request, FromRequest},
};
use axum_macros::debug_handler;
@@ -14,7 +13,7 @@ where
{
type Rejection = ();
async fn from_request(_req: Request<axum::body::Body>, _state: &S) -> Result<Self, Self::Rejection> {
async fn from_request(_req: Request, _state: &S) -> Result<Self, Self::Rejection> {
unimplemented!()
}
}
@@ -1,5 +1,5 @@
error: Handlers must only take owned values
--> tests/debug_handler/fail/extract_self_mut.rs:24:22
--> tests/debug_handler/fail/extract_self_mut.rs:23:22
|
24 | async fn handler(&mut self) {}
23 | async fn handler(&mut self) {}
| ^^^^^^^^^
@@ -1,7 +1,6 @@
use axum::{
async_trait,
extract::FromRequest,
http::Request,
extract::{Request, FromRequest},
};
use axum_macros::debug_handler;
@@ -14,7 +13,7 @@ where
{
type Rejection = ();
async fn from_request(_req: Request<axum::body::Body>, _state: &S) -> Result<Self, Self::Rejection> {
async fn from_request(_req: Request, _state: &S) -> Result<Self, Self::Rejection> {
unimplemented!()
}
}
@@ -1,5 +1,5 @@
error: Handlers must only take owned values
--> tests/debug_handler/fail/extract_self_ref.rs:24:22
--> tests/debug_handler/fail/extract_self_ref.rs:23:22
|
24 | async fn handler(&self) {}
23 | async fn handler(&self) {}
| ^^^^^
@@ -1,7 +1,7 @@
use axum::{body::Body, extract::Extension, http::Request};
use axum::extract::{Extension, Request};
use axum_macros::debug_handler;
#[debug_handler]
async fn handler(_: Extension<String>, _: Request<Body>) {}
async fn handler(_: Extension<String>, _: Request) {}
fn main() {}
@@ -1,7 +1,6 @@
use axum::{
async_trait,
extract::FromRequest,
http::Request,
extract::{Request, FromRequest},
};
use axum_macros::debug_handler;
@@ -14,7 +13,7 @@ where
{
type Rejection = ();
async fn from_request(_req: Request<axum::body::Body>, _state: &S) -> Result<Self, Self::Rejection> {
async fn from_request(_req: Request, _state: &S) -> Result<Self, Self::Rejection> {
unimplemented!()
}
}
@@ -26,7 +25,7 @@ where
{
type Rejection = ();
async fn from_request(_req: Request<axum::body::Body>, _state: &S) -> Result<Self, Self::Rejection> {
async fn from_request(_req: Request, _state: &S) -> Result<Self, Self::Rejection> {
unimplemented!()
}
}
@@ -1,7 +1,6 @@
use axum_macros::debug_handler;
use axum::extract::{FromRef, FromRequest};
use axum::extract::{Request, FromRef, FromRequest};
use axum::async_trait;
use axum::http::Request;
#[debug_handler(state = AppState)]
async fn handler(_: A) {}
@@ -19,7 +18,7 @@ where
{
type Rejection = ();
async fn from_request(_req: Request<axum::body::Body>, _state: &S) -> Result<Self, Self::Rejection> {
async fn from_request(_req: Request, _state: &S) -> Result<Self, Self::Rejection> {
unimplemented!()
}
}
@@ -1,8 +1,8 @@
use axum_macros::debug_handler;
use axum::{extract::State, http::Request};
use axum::{extract::State, extract::Request};
#[debug_handler(state = AppState)]
async fn handler(_: State<AppState>, _: Request<axum::body::Body>) {}
async fn handler(_: State<AppState>, _: Request) {}
#[derive(Clone)]
struct AppState;