style: use Self to avoid unnecessary repetition (#3396)

This commit is contained in:
Theodore Bjernhed
2025-07-04 21:10:01 +00:00
committed by GitHub
parent b8d9a3e764
commit 0f255c3c4c
33 changed files with 137 additions and 138 deletions
+2
View File
@@ -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
}
+2
View File
@@ -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)