Skip to content

Commit

Permalink
Remove #[must_use] from set_tracer_provider (#501)
Browse files Browse the repository at this point in the history
Set `set_tracer_provider` no longer returns a guard: it returns back the existing tracing provider.
Therefore it should not be marked as `must_use`.
  • Loading branch information
Luca Palmieri committed Mar 29, 2021
1 parent b6d8494 commit 88bffef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion opentelemetry/src/global/trace.rs
Expand Up @@ -252,8 +252,10 @@ pub fn tracer_with_version(name: &'static str, version: &'static str) -> BoxedTr

/// Sets the given [`TracerProvider`] instance as the current global provider.
///
/// It returns the [`TracerProvider`] instance that was previously mounted as global provider
/// (e.g. [`NoopTracerProvider`] if a provider had not been set before).
///
/// [`TracerProvider`]: crate::trace::TracerProvider
#[must_use]
pub fn set_tracer_provider<P, T, S>(new_provider: P) -> GlobalTracerProvider
where
S: trace::Span + Send + Sync,
Expand Down

0 comments on commit 88bffef

Please sign in to comment.