Skip to content

Commit 2d8cfc7

Browse files
committed
refactor: add explicit lifetime annotations to FromRequestParts implementations
1 parent ecdd9d6 commit 2d8cfc7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

backend/src/auth.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ where
216216
{
217217
type Rejection = (StatusCode, String);
218218

219-
async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<Self, Self::Rejection> {
219+
async fn from_request_parts<'a>(
220+
parts: &'a mut Parts,
221+
_state: &S,
222+
) -> Result<Self, Self::Rejection> {
220223
let token = extract_token(&parts.headers).ok_or_else(|| {
221224
(
222225
StatusCode::UNAUTHORIZED,

backend/src/csrf.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@ where
232232
{
233233
type Rejection = (StatusCode, Json<ErrorResponse>);
234234

235-
async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<Self, Self::Rejection> {
235+
async fn from_request_parts<'a>(
236+
parts: &'a mut Parts,
237+
_state: &S,
238+
) -> Result<Self, Self::Rejection> {
236239
if matches!(
237240
parts.method,
238241
Method::GET | Method::HEAD | Method::OPTIONS | Method::TRACE

0 commit comments

Comments
 (0)