Skip to content

Commit e9abece

Browse files
committed
cargo fmt
1 parent 87f7e17 commit e9abece

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

bottlecap/src/http.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,15 @@ pub async fn extract_request_body(
121121
/// errors (e.g. an oversized payload exceeding `DefaultBodyLimit`), the body
122122
/// is replaced with empty bytes so that processing can continue with headers
123123
/// only.
124-
pub async fn extract_request_body_or_empty(
125-
request: Request,
126-
) -> (http::request::Parts, Bytes) {
124+
pub async fn extract_request_body_or_empty(request: Request) -> (http::request::Parts, Bytes) {
127125
let (parts, body) = request.into_parts();
128-
let bytes =
129-
match Bytes::from_request(Request::from_parts(parts.clone(), body), &()).await {
130-
Ok(b) => b,
131-
Err(e) => {
132-
warn!("Failed to buffer request body: {e}. Processing with empty payload.");
133-
Bytes::new()
134-
}
135-
};
126+
let bytes = match Bytes::from_request(Request::from_parts(parts.clone(), body), &()).await {
127+
Ok(b) => b,
128+
Err(e) => {
129+
warn!("Failed to buffer request body: {e}. Processing with empty payload.");
130+
Bytes::new()
131+
}
132+
};
136133
(parts, bytes)
137134
}
138135

0 commit comments

Comments
 (0)