summaryrefslogtreecommitdiff
path: root/src/types/extract.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/types/extract.rs')
-rw-r--r--src/types/extract.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/types/extract.rs b/src/types/extract.rs
index 69c6ed8..7dbf386 100644
--- a/src/types/extract.rs
+++ b/src/types/extract.rs
@@ -22,7 +22,7 @@ impl<S> FromRequestParts<S> for AuthorizedUser where S: Send + Sync {
return Err(ResponseCode::Forbidden.text("No auth token provided"))
};
- let Ok(session) = Session::from_token(&token) else {
+ let Ok(session) = Session::from_token(token) else {
return Err(ResponseCode::Unauthorized.text("Auth token invalid"))
};
@@ -55,16 +55,16 @@ impl<S, B> FromRequest<S, B> for Log where
let uri = req.uri().clone();
let Ok(bytes) = Bytes::from_request(req, state).await else {
- console::log(info.ip().clone(), method.clone(), uri.clone(), Some(path.to_string()), None).await;
+ console::log(info.ip(), method.clone(), uri.clone(), Some(path.to_string()), None).await;
return Ok(Log)
};
let Ok(body) = String::from_utf8(bytes.bytes().flatten().collect()) else {
- console::log(info.ip().clone(), method.clone(), uri.clone(), Some(path.to_string()), None).await;
+ console::log(info.ip(), method.clone(), uri.clone(), Some(path.to_string()), None).await;
return Ok(Log)
};
- console::log(info.ip().clone(), method.clone(), uri.clone(), Some(path.to_string()), Some(body.to_string())).await;
+ console::log(info.ip(), method.clone(), uri.clone(), Some(path.to_string()), Some(body.to_string())).await;
Ok(Log)
}
@@ -101,7 +101,7 @@ impl<T, S, B> FromRequest<S, B> for Json<T> where
return Err(ResponseCode::BadRequest.text("Invalid utf8 body"))
};
- console::log(info.ip().clone(), method.clone(), uri.clone(), Some(path.to_string()), Some(body.to_string())).await;
+ console::log(info.ip(), method.clone(), uri.clone(), Some(path.to_string()), Some(body.to_string())).await;
let Ok(value) = serde_json::from_str::<T>(&body) else {
return Err(ResponseCode::BadRequest.text("Invalid request body"))