From 46726def4cd70a966f64537757ecf42ac2da40df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Wed, 22 Apr 2020 14:54:58 +0200 Subject: [PATCH] Add `must_use` to `dispatcher::set_default` --- tracing-core/src/dispatcher.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tracing-core/src/dispatcher.rs b/tracing-core/src/dispatcher.rs index c5c01380f5..399504ab5f 100644 --- a/tracing-core/src/dispatcher.rs +++ b/tracing-core/src/dispatcher.rs @@ -231,6 +231,7 @@ pub fn with_default(dispatcher: &Dispatch, f: impl FnOnce() -> T) -> T { /// [`set_global_default`]: ../fn.set_global_default.html #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] +#[must_use = "Dropping the guard unregisters the dispatcher."] pub fn set_default(dispatcher: &Dispatch) -> DefaultGuard { // When this guard is dropped, the default dispatcher will be reset to the // prior default. Using this ensures that we always reset to the prior