mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Replace async_trait with AFIT / RPITIT (#2308)
Co-authored-by: Jonas Platte <[email protected]>
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
use axum::{
|
||||
async_trait,
|
||||
extract::{Request, FromRequest},
|
||||
};
|
||||
use axum::extract::{FromRequest, Request};
|
||||
use axum_macros::debug_handler;
|
||||
|
||||
struct A;
|
||||
|
||||
#[async_trait]
|
||||
impl<S> FromRequest<S> for A
|
||||
where
|
||||
S: Send + Sync,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: Handlers must only take owned values
|
||||
--> tests/debug_handler/fail/extract_self_mut.rs:23:22
|
||||
--> tests/debug_handler/fail/extract_self_mut.rs:19:22
|
||||
|
|
||||
23 | async fn handler(&mut self) {}
|
||||
19 | async fn handler(&mut self) {}
|
||||
| ^^^^^^^^^
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
use axum::{
|
||||
async_trait,
|
||||
extract::{Request, FromRequest},
|
||||
};
|
||||
use axum::extract::{FromRequest, Request};
|
||||
use axum_macros::debug_handler;
|
||||
|
||||
struct A;
|
||||
|
||||
#[async_trait]
|
||||
impl<S> FromRequest<S> for A
|
||||
where
|
||||
S: Send + Sync,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: Handlers must only take owned values
|
||||
--> tests/debug_handler/fail/extract_self_ref.rs:23:22
|
||||
--> tests/debug_handler/fail/extract_self_ref.rs:19:22
|
||||
|
|
||||
23 | async fn handler(&self) {}
|
||||
19 | async fn handler(&self) {}
|
||||
| ^^^^^
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use axum::{async_trait, extract::FromRequestParts, http::request::Parts, response::IntoResponse};
|
||||
use axum::{extract::FromRequestParts, http::request::Parts, response::IntoResponse};
|
||||
use axum_macros::debug_handler;
|
||||
|
||||
fn main() {}
|
||||
@@ -115,7 +115,6 @@ impl A {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<S> FromRequestParts<S> for A
|
||||
where
|
||||
S: Send + Sync,
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
use axum::{
|
||||
async_trait,
|
||||
extract::{Request, FromRequest},
|
||||
};
|
||||
use axum::extract::{FromRequest, Request};
|
||||
use axum_macros::debug_handler;
|
||||
|
||||
struct A;
|
||||
|
||||
#[async_trait]
|
||||
impl<S> FromRequest<S> for A
|
||||
where
|
||||
S: Send + Sync,
|
||||
@@ -18,7 +14,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl<S> FromRequest<S> for Box<A>
|
||||
where
|
||||
S: Send + Sync,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use axum::extract::{FromRef, FromRequest, Request};
|
||||
use axum_macros::debug_handler;
|
||||
use axum::extract::{Request, FromRef, FromRequest};
|
||||
use axum::async_trait;
|
||||
|
||||
#[debug_handler(state = AppState)]
|
||||
async fn handler(_: A) {}
|
||||
@@ -10,7 +9,6 @@ struct AppState;
|
||||
|
||||
struct A;
|
||||
|
||||
#[async_trait]
|
||||
impl<S> FromRequest<S> for A
|
||||
where
|
||||
S: Send + Sync,
|
||||
|
||||
Reference in New Issue
Block a user