Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeschastny committed Jan 2, 2025
1 parent 69e8759 commit ba4ad5f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use tracing_opentelemetry_instrumentation_sdk as otel;
// copy from crate opentelemetry-http (to not be dependants of on 3rd: http, ...)
pub struct HeaderInjector<'a>(pub &'a mut http::HeaderMap);

impl<'a> Injector for HeaderInjector<'a> {
impl Injector for HeaderInjector<'_> {
/// Set a key and value in the `HeaderMap`. Does nothing if the key or value are not valid inputs.
fn set(&mut self, key: &str, value: String) {
if let Ok(name) = http::header::HeaderName::from_bytes(key.as_bytes()) {
Expand All @@ -22,7 +22,7 @@ impl<'a> Injector for HeaderInjector<'a> {

pub struct HeaderExtractor<'a>(pub &'a http::HeaderMap);

impl<'a> Extractor for HeaderExtractor<'a> {
impl Extractor for HeaderExtractor<'_> {
/// Get a value for a key from the `HeaderMap`. If the value is not valid ASCII, returns None.
fn get(&self, key: &str) -> Option<&str> {
self.0.get(key).and_then(|value| value.to_str().ok())
Expand Down
4 changes: 0 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ impl DetectResource {
/// `service.name` is first extracted from environment variables
/// (in this order) `OTEL_SERVICE_NAME`, `SERVICE_NAME`, `APP_NAME`.
/// But a default value can be provided with this method.
/// `service.name` is first extracted from environment variables
/// (in this order) `SERVICE_VERSION`, `APP_VERSION`.
/// But a default value can be provided with this method.
pub fn new(
fallback_service_name: &'static str,
fallback_service_version: &'static str,
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/aws/operations/dynamodb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub const LEGACY_DB_NAME: &str = semconv::DB_NAME;

pub enum DynamodbSpanBuilder {}

impl<'a> AwsSpanBuilder<'a> {
impl AwsSpanBuilder<'_> {
pub fn dynamodb(
method: impl Into<StringValue>,
table_names: impl IntoIterator<Item = impl Into<StringValue>>,
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/aws/operations/firehose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::*;

pub enum FirehoseSpanBuilder {}

impl<'a> AwsSpanBuilder<'a> {
impl AwsSpanBuilder<'_> {
pub fn firehose(
operation_kind: MessagingOperationKind,
method: impl Into<StringValue>,
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/aws/operations/sns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::*;

pub enum SnsSpanBuilder {}

impl<'a> AwsSpanBuilder<'a> {
impl AwsSpanBuilder<'_> {
pub fn sns(
operation_kind: MessagingOperationKind,
method: impl Into<StringValue>,
Expand Down

0 comments on commit ba4ad5f

Please sign in to comment.