Implement Deref and DerefMut for built-in extractors (#1922)

This commit is contained in:
David Pedersen
2023-04-10 07:18:35 +00:00
committed by GitHub
parent 43b2d52403
commit 352cf9a266
17 changed files with 67 additions and 112 deletions
+2 -8
View File
@@ -6,7 +6,7 @@ use axum::{
};
use http::{request::Parts, StatusCode};
use serde::de::DeserializeOwned;
use std::{fmt, ops::Deref};
use std::fmt;
/// Extractor that deserializes query strings into some type.
///
@@ -73,13 +73,7 @@ where
}
}
impl<T> Deref for Query<T> {
type Target = T;
fn deref(&self) -> &Self::Target {
&self.0
}
}
axum_core::__impl_deref!(Query);
/// Rejection used for [`Query`].
///