mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
style: use Self to avoid unnecessary repetition (#3396)
This commit is contained in:
@@ -42,6 +42,7 @@ where
|
||||
{
|
||||
type Rejection = T::Rejection;
|
||||
|
||||
#[allow(clippy::use_self)]
|
||||
fn from_request_parts(
|
||||
parts: &mut Parts,
|
||||
state: &S,
|
||||
@@ -57,6 +58,7 @@ where
|
||||
{
|
||||
type Rejection = T::Rejection;
|
||||
|
||||
#[allow(clippy::use_self)]
|
||||
async fn from_request(req: Request, state: &S) -> Result<Option<T>, Self::Rejection> {
|
||||
T::from_request(req, state).await
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ where
|
||||
|
||||
async fn from_request(req: Request, _: &S) -> Result<Self, Self::Rejection> {
|
||||
let mut body = req.into_limited_body();
|
||||
#[allow(clippy::use_self)]
|
||||
let mut bytes = BytesMut::new();
|
||||
body_to_bytes_mut(&mut body, &mut bytes).await?;
|
||||
Ok(bytes)
|
||||
@@ -128,6 +129,7 @@ where
|
||||
}
|
||||
})?;
|
||||
|
||||
#[allow(clippy::use_self)]
|
||||
let string = String::from_utf8(bytes.into()).map_err(InvalidUtf8::from_err)?;
|
||||
|
||||
Ok(string)
|
||||
|
||||
Reference in New Issue
Block a user