Open
Description
Bug Report
Version
tracing-core
v0.1.21
Also current 0.2.0 as documented on tracing.rs
Crates
tracing-core
Description
tracing_core::dispatcher::get_default()
(and consequently tracing::dispatcher::get_default()
) takes a FnMut
argument, which it executes exactly once. The use of FnMut
here is unnecessarily restrictive.
Proposal
Change it to take an FnOnce
. This is a backwards-compatible change (as every FnMut
is also an FnOnce
). The implementation can just wrap it in an Option
and use take()
to pull out the function; this is safe as the function will be called exactly once for every possible code path.