diff --git a/examples/tracing-grpc/src/client.rs b/examples/tracing-grpc/src/client.rs index c871e9ca8d..29a9353621 100644 --- a/examples/tracing-grpc/src/client.rs +++ b/examples/tracing-grpc/src/client.rs @@ -22,7 +22,7 @@ fn init_tracer() -> sdktrace::TracerProvider { struct MetadataMap<'a>(&'a mut tonic::metadata::MetadataMap); -impl<'a> Injector for MetadataMap<'a> { +impl Injector for MetadataMap<'_> { /// Set a key and value in the MetadataMap. Does nothing if the key or value are not valid inputs fn set(&mut self, key: &str, value: String) { if let Ok(key) = tonic::metadata::MetadataKey::from_bytes(key.as_bytes()) { diff --git a/examples/tracing-grpc/src/server.rs b/examples/tracing-grpc/src/server.rs index aadb77b6e6..24a9e09481 100644 --- a/examples/tracing-grpc/src/server.rs +++ b/examples/tracing-grpc/src/server.rs @@ -29,7 +29,7 @@ pub mod hello_world { struct MetadataMap<'a>(&'a tonic::metadata::MetadataMap); -impl<'a> Extractor for MetadataMap<'a> { +impl Extractor for MetadataMap<'_> { /// Get a value for a key from the MetadataMap. If the value can't be converted to &str, returns None fn get(&self, key: &str) -> Option<&str> { self.0.get(key).and_then(|metadata| metadata.to_str().ok()) diff --git a/opentelemetry-appender-log/src/lib.rs b/opentelemetry-appender-log/src/lib.rs index b792aa220e..3f6bcb6acf 100644 --- a/opentelemetry-appender-log/src/lib.rs +++ b/opentelemetry-appender-log/src/lib.rs @@ -239,7 +239,7 @@ mod any_value { pub(crate) fn serialize(value: log::kv::Value) -> Option { struct ValueVisitor(Option); - impl<'kvs> log::kv::VisitValue<'kvs> for ValueVisitor { + impl log::kv::VisitValue<'_> for ValueVisitor { fn visit_any(&mut self, value: log::kv::Value) -> Result<(), log::kv::Error> { self.0 = Some(AnyValue::String(StringValue::from(value.to_string()))); diff --git a/opentelemetry-otlp/tests/integration_test/src/lib.rs b/opentelemetry-otlp/tests/integration_test/src/lib.rs index 3b6903633e..b74fedd242 100644 --- a/opentelemetry-otlp/tests/integration_test/src/lib.rs +++ b/opentelemetry-otlp/tests/integration_test/src/lib.rs @@ -1,4 +1,3 @@ -use ctor::dtor; pub mod images; pub mod logs_asserter; diff --git a/opentelemetry-otlp/tests/integration_test/src/test_utils.rs b/opentelemetry-otlp/tests/integration_test/src/test_utils.rs index ead933a71f..75f389788f 100644 --- a/opentelemetry-otlp/tests/integration_test/src/test_utils.rs +++ b/opentelemetry-otlp/tests/integration_test/src/test_utils.rs @@ -1,6 +1,4 @@ use crate::images::Collector; -use ctor::dtor; -use std::fs; use std::fs::File; use std::os::unix::fs::PermissionsExt; use std::sync::{Arc, Mutex, OnceLock}; diff --git a/opentelemetry-otlp/tests/integration_test/tests/logs.rs b/opentelemetry-otlp/tests/integration_test/tests/logs.rs index 54e5bb9c41..11d3825ed2 100644 --- a/opentelemetry-otlp/tests/integration_test/tests/logs.rs +++ b/opentelemetry-otlp/tests/integration_test/tests/logs.rs @@ -8,9 +8,8 @@ use log::{info, Level}; use opentelemetry::KeyValue; use opentelemetry_appender_log::OpenTelemetryLogBridge; use opentelemetry_otlp::LogExporter; -use opentelemetry_sdk::logs::{LogError, LoggerProvider}; +use opentelemetry_sdk::logs::LoggerProvider; use opentelemetry_sdk::{logs as sdklogs, runtime, Resource}; -use std::error::Error; use std::fs::File; use std::os::unix::fs::MetadataExt; use std::time::Duration; diff --git a/opentelemetry-otlp/tests/integration_test/tests/traces.rs b/opentelemetry-otlp/tests/integration_test/tests/traces.rs index 98aebab7eb..a334de7146 100644 --- a/opentelemetry-otlp/tests/integration_test/tests/traces.rs +++ b/opentelemetry-otlp/tests/integration_test/tests/traces.rs @@ -14,7 +14,6 @@ use ctor::dtor; use integration_test_runner::test_utils; use opentelemetry_proto::tonic::trace::v1::TracesData; use opentelemetry_sdk::{runtime, trace as sdktrace, Resource}; -use std::error::Error; use std::fs::File; use std::io::Write; use std::os::unix::fs::MetadataExt; @@ -98,7 +97,7 @@ pub fn assert_traces_results(result: &str, expected: &str) -> Result<()> { #[test] #[should_panic(expected = "left: \"Sub operation...\"")] // we swap the parent spans with child spans in failed_traces.json -pub fn test_assert_span_eq_failure() -> () { +pub fn test_assert_span_eq_failure() { let left = read_spans_from_json(File::open("./expected/traces.json").unwrap()).unwrap(); let right = read_spans_from_json(File::open("./expected/failed_traces.json").unwrap()).unwrap(); diff --git a/stress/src/throughput.rs b/stress/src/throughput.rs index 8116f904ee..131762fab7 100644 --- a/stress/src/throughput.rs +++ b/stress/src/throughput.rs @@ -140,8 +140,8 @@ struct UnsafeSlice<'a> { slice: &'a [UnsafeCell], } -unsafe impl<'a> Send for UnsafeSlice<'a> {} -unsafe impl<'a> Sync for UnsafeSlice<'a> {} +unsafe impl Send for UnsafeSlice<'_> {} +unsafe impl Sync for UnsafeSlice<'_> {} impl<'a> UnsafeSlice<'a> { fn new(slice: &'a mut [WorkerStats]) -> Self { @@ -155,7 +155,7 @@ impl<'a> UnsafeSlice<'a> { #[inline(always)] unsafe fn increment(&self, i: usize) { let value = self.slice[i].get(); - (*value).count = (*value).count + 1; + (*value).count += 1; } #[inline(always)]