Skip to content

Commit

Permalink
Fix formatting in Rust tracing client. (#1296)
Browse files Browse the repository at this point in the history
Needed to stop Rust linting from failing in CI.
  • Loading branch information
obi1kenobi authored Dec 9, 2024
1 parent b548b4a commit f780182
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ async fn handle_request(body: Vec<u8>, content_type_str: String) -> Vec<Multipar
assert!(content_type_str.starts_with("multipart/form-data"));

let boundary = content_type_str.split("boundary=").nth(1).unwrap();
let stream = futures::stream::once(
async move { Ok::<_, Box<dyn Error + Send + Sync>>(multer::bytes::Bytes::copy_from_slice(body.as_slice())) }
);
let stream = futures::stream::once(async move {
Ok::<_, Box<dyn Error + Send + Sync>>(multer::bytes::Bytes::copy_from_slice(
body.as_slice(),
))
});
let mut mp = Multipart::new(stream, boundary);

let mut fields = Vec::new();
Expand All @@ -40,9 +42,9 @@ async fn handle_request(body: Vec<u8>, content_type_str: String) -> Vec<Multipar
let field_content_type = field.content_type().map(|ct| ct.to_string());
let field_filename = field.file_name().map(String::from);

let content = String::from_utf8(
field.bytes().await.expect("failed to read field bytes").into(),
).expect("failed to turn field data into string");
let content =
String::from_utf8(field.bytes().await.expect("failed to read field bytes").into())
.expect("failed to turn field data into string");

let multipart_field = MultipartField {
name: field_name,
Expand Down

0 comments on commit f780182

Please sign in to comment.