Skip to content

Commit f85c127

Browse files
committed
chore: clippy
1 parent 35034f4 commit f85c127

File tree

8 files changed

+8
-13
lines changed

8 files changed

+8
-13
lines changed

examples/tracing-grpc/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn init_tracer() -> sdktrace::TracerProvider {
2222

2323
struct MetadataMap<'a>(&'a mut tonic::metadata::MetadataMap);
2424

25-
impl<'a> Injector for MetadataMap<'a> {
25+
impl Injector for MetadataMap<'_> {
2626
/// Set a key and value in the MetadataMap. Does nothing if the key or value are not valid inputs
2727
fn set(&mut self, key: &str, value: String) {
2828
if let Ok(key) = tonic::metadata::MetadataKey::from_bytes(key.as_bytes()) {

examples/tracing-grpc/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub mod hello_world {
2929

3030
struct MetadataMap<'a>(&'a tonic::metadata::MetadataMap);
3131

32-
impl<'a> Extractor for MetadataMap<'a> {
32+
impl Extractor for MetadataMap<'_> {
3333
/// Get a value for a key from the MetadataMap. If the value can't be converted to &str, returns None
3434
fn get(&self, key: &str) -> Option<&str> {
3535
self.0.get(key).and_then(|metadata| metadata.to_str().ok())

opentelemetry-appender-log/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ mod any_value {
239239
pub(crate) fn serialize(value: log::kv::Value) -> Option<AnyValue> {
240240
struct ValueVisitor(Option<AnyValue>);
241241

242-
impl<'kvs> log::kv::VisitValue<'kvs> for ValueVisitor {
242+
impl log::kv::VisitValue<'_> for ValueVisitor {
243243
fn visit_any(&mut self, value: log::kv::Value) -> Result<(), log::kv::Error> {
244244
self.0 = Some(AnyValue::String(StringValue::from(value.to_string())));
245245

opentelemetry-otlp/tests/integration_test/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use ctor::dtor;
21

32
pub mod images;
43
pub mod logs_asserter;

opentelemetry-otlp/tests/integration_test/src/test_utils.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
use crate::images::Collector;
2-
use ctor::dtor;
3-
use std::fs;
42
use std::fs::File;
53
use std::os::unix::fs::PermissionsExt;
64
use std::sync::{Arc, Mutex, OnceLock};

opentelemetry-otlp/tests/integration_test/tests/logs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ use log::{info, Level};
88
use opentelemetry::KeyValue;
99
use opentelemetry_appender_log::OpenTelemetryLogBridge;
1010
use opentelemetry_otlp::LogExporter;
11-
use opentelemetry_sdk::logs::{LogError, LoggerProvider};
11+
use opentelemetry_sdk::logs::LoggerProvider;
1212
use opentelemetry_sdk::{logs as sdklogs, runtime, Resource};
13-
use std::error::Error;
1413
use std::fs::File;
1514
use std::os::unix::fs::MetadataExt;
1615
use std::time::Duration;

opentelemetry-otlp/tests/integration_test/tests/traces.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use ctor::dtor;
1414
use integration_test_runner::test_utils;
1515
use opentelemetry_proto::tonic::trace::v1::TracesData;
1616
use opentelemetry_sdk::{runtime, trace as sdktrace, Resource};
17-
use std::error::Error;
1817
use std::fs::File;
1918
use std::io::Write;
2019
use std::os::unix::fs::MetadataExt;
@@ -98,7 +97,7 @@ pub fn assert_traces_results(result: &str, expected: &str) -> Result<()> {
9897

9998
#[test]
10099
#[should_panic(expected = "left: \"Sub operation...\"")] // we swap the parent spans with child spans in failed_traces.json
101-
pub fn test_assert_span_eq_failure() -> () {
100+
pub fn test_assert_span_eq_failure() {
102101
let left = read_spans_from_json(File::open("./expected/traces.json").unwrap()).unwrap();
103102
let right = read_spans_from_json(File::open("./expected/failed_traces.json").unwrap()).unwrap();
104103

stress/src/throughput.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ struct UnsafeSlice<'a> {
140140
slice: &'a [UnsafeCell<WorkerStats>],
141141
}
142142

143-
unsafe impl<'a> Send for UnsafeSlice<'a> {}
144-
unsafe impl<'a> Sync for UnsafeSlice<'a> {}
143+
unsafe impl Send for UnsafeSlice<'_> {}
144+
unsafe impl Sync for UnsafeSlice<'_> {}
145145

146146
impl<'a> UnsafeSlice<'a> {
147147
fn new(slice: &'a mut [WorkerStats]) -> Self {
@@ -155,7 +155,7 @@ impl<'a> UnsafeSlice<'a> {
155155
#[inline(always)]
156156
unsafe fn increment(&self, i: usize) {
157157
let value = self.slice[i].get();
158-
(*value).count = (*value).count + 1;
158+
(*value).count += 1;
159159
}
160160

161161
#[inline(always)]

0 commit comments

Comments
 (0)