clippy
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
asonix 2023-05-23 16:47:03 -05:00
parent 0a54e7aefa
commit efa1d019f6

View file

@ -124,19 +124,19 @@ where
match request_head.version { match request_head.version {
actix_http::Version::HTTP_09 => { actix_http::Version::HTTP_09 => {
span.record("http.flavor", &"0.9"); span.record("http.flavor", "0.9");
} }
actix_http::Version::HTTP_10 => { actix_http::Version::HTTP_10 => {
span.record("http.flavor", &"1.0"); span.record("http.flavor", "1.0");
} }
actix_http::Version::HTTP_11 => { actix_http::Version::HTTP_11 => {
span.record("http.flavor", &"1.1"); span.record("http.flavor", "1.1");
} }
actix_http::Version::HTTP_2 => { actix_http::Version::HTTP_2 => {
span.record("http.flavor", &"2.0"); span.record("http.flavor", "2.0");
} }
actix_http::Version::HTTP_3 => { actix_http::Version::HTTP_3 => {
span.record("http.flavor", &"3.0"); span.record("http.flavor", "3.0");
} }
_ => (), _ => (),
} }
@ -193,9 +193,9 @@ where
.map_ok(|succ| match succ { .map_ok(|succ| match succ {
ConnectResponse::Client(client_response) => { ConnectResponse::Client(client_response) => {
let status: i32 = client_response.status().as_u16().into(); let status: i32 = client_response.status().as_u16().into();
span.record("http.status_code", &status); span.record("http.status_code", status);
if client_response.status().is_client_error() { if client_response.status().is_client_error() {
span.record("otel.status_code", &"ERROR"); span.record("otel.status_code", "ERROR");
} }
ConnectResponse::Client(client_response.map_body(|_, payload| { ConnectResponse::Client(client_response.map_body(|_, payload| {
@ -208,15 +208,15 @@ where
} }
ConnectResponse::Tunnel(response_head, etc) => { ConnectResponse::Tunnel(response_head, etc) => {
let status: i32 = response_head.status.as_u16().into(); let status: i32 = response_head.status.as_u16().into();
span.record("http.status_code", &status); span.record("http.status_code", status);
if response_head.status.is_client_error() { if response_head.status.is_client_error() {
span.record("otel.status_code", &"ERROR"); span.record("otel.status_code", "ERROR");
} }
ConnectResponse::Tunnel(response_head, etc) ConnectResponse::Tunnel(response_head, etc)
} }
}) })
.map_err(|err| { .map_err(|err| {
span.record("otel.status_code", &"ERROR"); span.record("otel.status_code", "ERROR");
span.record( span.record(
"exception.message", "exception.message",
&tracing::field::display(&format!("{}", err)), &tracing::field::display(&format!("{}", err)),