mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-12-17 20:58:58 -05:00
apply new rustfmt.toml changes, fix some clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
0317cc8cc5
commit
77e0b76408
296 changed files with 7147 additions and 4300 deletions
|
|
@ -20,14 +20,17 @@ pub(super) struct Request {
|
|||
pub(super) parts: Parts,
|
||||
}
|
||||
|
||||
pub(super) async fn from(services: &Services, request: hyper::Request<axum::body::Body>) -> Result<Request> {
|
||||
pub(super) async fn from(
|
||||
services: &Services,
|
||||
request: hyper::Request<axum::body::Body>,
|
||||
) -> Result<Request> {
|
||||
let limited = request.with_limited_body();
|
||||
let (mut parts, body) = limited.into_parts();
|
||||
|
||||
let path: Path<Vec<String>> = parts.extract().await?;
|
||||
let query = parts.uri.query().unwrap_or_default();
|
||||
let query =
|
||||
serde_html_form::from_str(query).map_err(|e| err!(Request(Unknown("Failed to read query parameters: {e}"))))?;
|
||||
let query = serde_html_form::from_str(query)
|
||||
.map_err(|e| err!(Request(Unknown("Failed to read query parameters: {e}"))))?;
|
||||
|
||||
let max_body_size = services.globals.config.max_request_size;
|
||||
|
||||
|
|
@ -35,10 +38,5 @@ pub(super) async fn from(services: &Services, request: hyper::Request<axum::body
|
|||
.await
|
||||
.map_err(|e| err!(Request(TooLarge("Request body too large: {e}"))))?;
|
||||
|
||||
Ok(Request {
|
||||
path,
|
||||
query,
|
||||
body,
|
||||
parts,
|
||||
})
|
||||
Ok(Request { path, query, body, parts })
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue