From 538e448fcbd2512ef0d1bfc041f359d7914c36df Mon Sep 17 00:00:00 2001 From: Andrei Ozerov Date: Sun, 14 Feb 2021 22:19:46 +0300 Subject: [PATCH] Lint: fix issues with unnecessary wraps Remove `Result` from return types in tests of `opentelemetry-datadog`, `opentelemetry-jaeger`, `opentelemetry-otlp`, `opentelemetry-zipkin`. Reference: https://github.com/rust-lang/rust-clippy/pull/6070 --- opentelemetry-datadog/src/exporter/mod.rs | 4 +--- opentelemetry-jaeger/src/exporter/mod.rs | 3 +-- opentelemetry-otlp/src/transform/metrics.rs | 4 +--- opentelemetry-zipkin/src/exporter/model/span.rs | 4 +--- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/opentelemetry-datadog/src/exporter/mod.rs b/opentelemetry-datadog/src/exporter/mod.rs index fae7322c05..df02771033 100644 --- a/opentelemetry-datadog/src/exporter/mod.rs +++ b/opentelemetry-datadog/src/exporter/mod.rs @@ -192,7 +192,7 @@ mod tests { use crate::exporter::model::tests::get_span; #[test] - fn test_out_of_order_group() -> Result<(), Box> { + fn test_out_of_order_group() { let batch = vec![get_span(1, 1, 1), get_span(2, 2, 2), get_span(1, 1, 3)]; let expected = vec![ vec![get_span(1, 1, 1), get_span(1, 1, 3)], @@ -204,7 +204,5 @@ mod tests { traces.sort_by_key(|t| t[0].span_context.trace_id().to_u128()); assert_eq!(traces, expected); - - Ok(()) } } diff --git a/opentelemetry-jaeger/src/exporter/mod.rs b/opentelemetry-jaeger/src/exporter/mod.rs index 35b2feccad..2f7c4d1d08 100644 --- a/opentelemetry-jaeger/src/exporter/mod.rs +++ b/opentelemetry-jaeger/src/exporter/mod.rs @@ -782,7 +782,7 @@ mod tests { } #[test] - fn test_set_status() -> Result<(), Box> { + fn test_set_status() { for (status_code, error_msg, status_tag_val, msg_tag_val) in get_error_tag_test_data() { let tags = build_span_tags( EvictedHashMap::new(20, 20), @@ -803,6 +803,5 @@ mod tests { assert_tag_not_contains(tags.clone(), OTEL_STATUS_DESCRIPTION); } } - Ok(()) } } diff --git a/opentelemetry-otlp/src/transform/metrics.rs b/opentelemetry-otlp/src/transform/metrics.rs index be9af226dd..2c4debcde1 100644 --- a/opentelemetry-otlp/src/transform/metrics.rs +++ b/opentelemetry-otlp/src/transform/metrics.rs @@ -731,7 +731,7 @@ mod tests { } #[test] - fn test_sink() -> Result<(), MetricsError> { + fn test_sink() { let test_data: Vec<(ResourceWrapper, InstrumentationLibrary, Metric)> = vec![ ( vec![("runtime", "tokio")], @@ -826,8 +826,6 @@ mod tests { for (expect, actual) in expect.into_iter().zip(actual.into_iter()) { assert_resource_metrics(expect, actual); } - - Ok(()) } } } diff --git a/opentelemetry-zipkin/src/exporter/model/span.rs b/opentelemetry-zipkin/src/exporter/model/span.rs index 9467480417..6e4b34472f 100644 --- a/opentelemetry-zipkin/src/exporter/model/span.rs +++ b/opentelemetry-zipkin/src/exporter/model/span.rs @@ -156,7 +156,7 @@ mod tests { } #[test] - fn test_set_status() -> Result<(), Box> { + fn test_set_status() { for (status_code, status_msg, status_tag_val, status_msg_tag_val) in get_set_status_test_data() { @@ -188,7 +188,5 @@ mod tests { assert_tag_contains(tags, OTEL_ERROR_DESCRIPTION, status_msg_tag_val); }; } - - Ok(()) } }