Skip to content

Commit 5af550f

Browse files
committed
🚨 apply clippy suggestions
Signed-off-by: David Bernard <david.bernard.31@gmail.com>
1 parent b74b772 commit 5af550f

File tree

1 file changed

+5
-3
lines changed
  • tracing-opentelemetry-instrumentation-sdk/src/http

1 file changed

+5
-3
lines changed

tracing-opentelemetry-instrumentation-sdk/src/http/tools.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ pub fn http_host<B>(req: &http::Request<B>) -> &str {
101101
.unwrap_or("")
102102
}
103103

104-
/// gRPC status codes
105-
/// [gRPC status codes]: https://github.com/grpc/grpc/blob/master/doc/statuscodes.md#status-codes-and-their-use-in-grpc
104+
/// [`gRPC` status codes](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md#status-codes-and-their-use-in-grpc)
106105
/// copied from tonic
107106
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
108107
pub enum GrpcCode {
@@ -259,7 +258,10 @@ mod tests {
259258
let mut headers = http::HeaderMap::new();
260259
headers.insert("grpc-status", input.to_string().parse().unwrap());
261260
if input > -1 {
262-
assert_eq!(grpc_status_from_http_header(&headers), Some(input as u16));
261+
assert_eq!(
262+
grpc_status_from_http_header(&headers),
263+
Some(u16::try_from(input).unwrap())
264+
);
263265
} else {
264266
assert_eq!(grpc_status_from_http_header(&headers), None);
265267
}

0 commit comments

Comments
 (0)