Support Option and Result in typed paths (#1001)

* Support `Option` and `Result` in typed paths

* changelog

* Update axum-extra/CHANGELOG.md

Co-authored-by: Jonas Platte <[email protected]>

* fix one more

Co-authored-by: Jonas Platte <[email protected]>
This commit is contained in:
David Pedersen
2022-05-06 09:42:10 +02:00
committed by GitHub
co-authored by Jonas Platte
parent d19beffd6d
commit 4ff78e552d
4 changed files with 53 additions and 2 deletions
+20
View File
@@ -190,6 +190,26 @@ macro_rules! impl_first_element_is {
where
P: TypedPath
{}
impl<P, $($ty,)*> FirstElementIs<P> for (Option<P>, $($ty,)*)
where
P: TypedPath
{}
impl<P, $($ty,)*> Sealed for (Option<P>, $($ty,)*)
where
P: TypedPath
{}
impl<P, E, $($ty,)*> FirstElementIs<P> for (Result<P, E>, $($ty,)*)
where
P: TypedPath
{}
impl<P, E, $($ty,)*> Sealed for (Result<P, E>, $($ty,)*)
where
P: TypedPath
{}
};
}