diff --git a/src/root_span_macro.rs b/src/root_span_macro.rs index 78a239a44..d5f4b0b74 100644 --- a/src/root_span_macro.rs +++ b/src/root_span_macro.rs @@ -123,6 +123,10 @@ pub mod private { pub use tracing; #[doc(hidden)] + // We need to allow unused variables because the function + // body is empty if the user of the library chose not to activate + // any OTEL feature. + #[allow(unused_variables)] pub fn set_otel_parent(req: &ServiceRequest, span: &tracing::Span) { #[cfg(any( feature = "opentelemetry_0_13",