mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-25 00:00:23 +02:00
Add Either{2..8} to axum-extra (#1263)
* Add `Either{2..8}`
* Apply suggestions from code review
Co-authored-by: Jonas Platte <[email protected]>
* Either2 => Either
* Update axum-extra/src/either.rs
Co-authored-by: Jonas Platte <[email protected]>
Co-authored-by: Jonas Platte <[email protected]>
This commit is contained in:
co-authored by
Jonas Platte
parent
fb21561616
commit
e22f6f9d2b
@@ -1,5 +1,5 @@
|
||||
use super::HandlerCallWithExtractors;
|
||||
use crate::Either;
|
||||
use crate::either::Either;
|
||||
use axum::{
|
||||
extract::{FromRequest, RequestParts},
|
||||
handler::Handler,
|
||||
@@ -40,12 +40,12 @@ where
|
||||
extractors: Either<Lt, Rt>,
|
||||
) -> <Self as HandlerCallWithExtractors<Either<Lt, Rt>, B>>::Future {
|
||||
match extractors {
|
||||
Either::Left(lt) => self
|
||||
Either::E1(lt) => self
|
||||
.lhs
|
||||
.call(lt)
|
||||
.map(IntoResponse::into_response as _)
|
||||
.left_future(),
|
||||
Either::Right(rt) => self
|
||||
Either::E2(rt) => self
|
||||
.rhs
|
||||
.call(rt)
|
||||
.map(IntoResponse::into_response as _)
|
||||
|
||||
Reference in New Issue
Block a user