Remove unneeded bounds on S in FromRequest(Parts) implementations

This doesn't actually allow using non-Send or non-Sync state types, but
it makes the docs simpler.
This commit is contained in:
Jonas Platte
2022-11-05 11:04:56 +01:00
parent da058db509
commit 05767b986e
39 changed files with 112 additions and 232 deletions
@@ -1,8 +1,4 @@
use axum::{
async_trait,
extract::FromRequest,
http::Request,
};
use axum::{async_trait, extract::FromRequest, http::Request};
use axum_macros::debug_handler;
struct A;
@@ -11,11 +7,10 @@ struct A;
impl<S, B> FromRequest<S, B> for A
where
B: Send + 'static,
S: Send + Sync,
{
type Rejection = ();
async fn from_request(_req: Request<B>, _state: &S) -> Result<Self, Self::Rejection> {
async fn from_request(_req: Request<B>, _: &S) -> Result<Self, Self::Rejection> {
unimplemented!()
}
}