Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
bragov4ik committed Aug 16, 2024
1 parent 32a9c1a commit fd02db4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libs/blockscout-service-launcher/src/launcher/span_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ fn handle_error(span: Span, status_code: StatusCode, response_error: &dyn Respon
// pre-formatting errors is a workaround for https://github.com/tokio-rs/tracing/issues/1565
let display = format!("{response_error}");
let debug = format!("{response_error:?}");
span.record("exception.message", &tracing::field::display(display));
span.record("exception.details", &tracing::field::display(debug));
span.record("exception.message", tracing::field::display(display));
span.record("exception.details", tracing::field::display(debug));
let code: i32 = status_code.as_u16().into();

span.record("http.status_code", code);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,14 @@ mod tests {
}

fn parse_json(s: &str) -> serde_json::Value {
serde_json::from_str::<serde_json::Value>(&s).expect(&format!("failed to parse '{}'", s))
serde_json::from_str::<serde_json::Value>(s)
.unwrap_or_else(|_| panic!("failed to parse '{}'", s))
}

fn parse_captured_logs(logs: String) -> Vec<serde_json::Value> {
logs.split('\n')
.filter(|l| !l.is_empty())
.map(|l| parse_json(l))
.map(parse_json)
.collect()
}

Expand Down

0 comments on commit fd02db4

Please sign in to comment.