Skip to content

Commit 423f82a

Browse files
committed
style
1 parent ebee758 commit 423f82a

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

relay-server/src/endpoints/spans.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,13 @@ where
2525
B::Data: Send + Into<Bytes>,
2626
B::Error: Into<axum::BoxError>,
2727
{
28-
let trace = if content_type.as_ref().starts_with("application/json") {
29-
let json: Json<TracesData> = request.extract().await?;
30-
Some(json.0)
28+
let trace: TracesData = if content_type.as_ref().starts_with("application/json") {
29+
let Json(trace) = request.extract().await?;
30+
trace
3131
} else if content_type.as_ref().starts_with("application/x-protobuf") {
32-
let protobuf: Protobuf<TracesData> = request.extract().await?;
33-
Some(protobuf.0)
32+
let Protobuf(trace) = request.extract().await?;
33+
trace
3434
} else {
35-
None
36-
};
37-
38-
let Some(trace) = trace else {
3935
return Ok(StatusCode::UNSUPPORTED_MEDIA_TYPE);
4036
};
4137

@@ -53,6 +49,7 @@ where
5349
}
5450
}
5551
common::handle_envelope(&state, envelope).await?;
52+
5653
Ok(StatusCode::ACCEPTED)
5754
}
5855

0 commit comments

Comments
 (0)