Deprecate extract::UrlParams and extract::UrlParamsMap (#138)

Use `extract::Path` instead. It supports everything the two other do,
and more.
This commit is contained in:
David Pedersen
2021-08-06 10:38:38 +02:00
committed by GitHub
parent a0ac8a5b78
commit 811b1d896c
4 changed files with 8 additions and 0 deletions
+3
View File
@@ -28,6 +28,7 @@ use std::{ops::Deref, str::FromStr};
/// Note that you can only have one URL params extractor per handler. If you
/// have multiple it'll response with `500 Internal Server Error`.
#[derive(Debug)]
#[deprecated(since = "0.1.3", note = "Use `axum::extract::Path` instead.")]
pub struct UrlParams<T>(pub T);
macro_rules! impl_parse_url {
@@ -35,6 +36,7 @@ macro_rules! impl_parse_url {
( $head:ident, $($tail:ident),* $(,)? ) => {
#[async_trait]
#[allow(deprecated)]
impl<B, $head, $($tail,)*> FromRequest<B> for UrlParams<($head, $($tail,)*)>
where
$head: FromStr + Send,
@@ -88,6 +90,7 @@ macro_rules! impl_parse_url {
impl_parse_url!(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16);
#[allow(deprecated)]
impl<T> Deref for UrlParams<T> {
type Target = T;