From 0328b5f25bd37f709b44e14730eb85cf9162ddbc Mon Sep 17 00:00:00 2001 From: Hayden Stainsby Date: Sat, 28 Jan 2023 01:44:10 +0100 Subject: [PATCH] chore: fix new clippy lints from 1.67.0 (#2451) There are new warnings as errors reported by clippy in Rust 1.67.0. This are causing builds to fail, e.g.: https://github.com/tokio-rs/tracing/actions/runs/4027112923/jobs/6922513360 In both cases they are reports of lifetimes that can be elided. This change removes the unnecessary lifetime annotations to make clippy happy. --- tracing-error/src/layer.rs | 4 ++-- tracing-opentelemetry/src/layer.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tracing-error/src/layer.rs b/tracing-error/src/layer.rs index e804c5e8f3..59f5e3e16a 100644 --- a/tracing-error/src/layer.rs +++ b/tracing-error/src/layer.rs @@ -103,9 +103,9 @@ where } impl WithContext { - pub(crate) fn with_context<'a>( + pub(crate) fn with_context( &self, - dispatch: &'a Dispatch, + dispatch: &Dispatch, id: &span::Id, mut f: impl FnMut(&'static Metadata<'static>, &str) -> bool, ) { diff --git a/tracing-opentelemetry/src/layer.rs b/tracing-opentelemetry/src/layer.rs index 7624b613e3..dc8a1c608d 100644 --- a/tracing-opentelemetry/src/layer.rs +++ b/tracing-opentelemetry/src/layer.rs @@ -83,9 +83,9 @@ pub(crate) struct WithContext( impl WithContext { // This function allows a function to be called in the context of the // "remembered" subscriber. - pub(crate) fn with_context<'a>( + pub(crate) fn with_context( &self, - dispatch: &'a tracing::Dispatch, + dispatch: &tracing::Dispatch, id: &span::Id, mut f: impl FnMut(&mut OtelData, &dyn PreSampledTracer), ) {