Skip to content

Commit

Permalink
fix(core): use From::from
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Nov 7, 2023
1 parent 9fce3e1 commit 7fbe587
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion viz-core/src/middleware/otel/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ fn build_attributes(req: &Request, http_route: &str) -> Vec<KeyValue> {
}
if let Some(port) = uri
.port_u16()
.and_then(|port| i64::try_from(port).ok())
.map(i64::from)
.filter(|port| *port != 80 && *port != 443)
{
attributes.push(SERVER_PORT.i64(port));
Expand Down
2 changes: 1 addition & 1 deletion viz-core/src/middleware/otel/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fn build_attributes(req: &Request, http_route: &str) -> OrderMap<Key, Value> {
}
if let Some(port) = uri
.port_u16()
.and_then(|len| i64::try_from(len).ok())
.map(i64::from)
.filter(|port| *port != 80 && *port != 443)
{
attributes.insert(SERVER_PORT, port.into());
Expand Down

0 comments on commit 7fbe587

Please sign in to comment.