mirror of
https://github.com/tokio-rs/tracing.git
synced 2025-10-02 15:24:47 +00:00
core: derive Default
for NoSubscriber
(#1785)
* core: derive `Default` for `NoSubscriber` * additional clippy nonsense Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
parent
6d9da940ff
commit
e080a03c5d
@ -568,15 +568,9 @@ impl Interest {
|
||||
///
|
||||
/// [`NoSubscriber`] implements the [`Subscriber`] trait by never being enabled,
|
||||
/// never being interested in any callsite, and dropping all spans and events.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Copy, Clone, Debug, Default)]
|
||||
pub struct NoSubscriber(());
|
||||
|
||||
impl Default for NoSubscriber {
|
||||
fn default() -> Self {
|
||||
NoSubscriber(())
|
||||
}
|
||||
}
|
||||
|
||||
impl Subscriber for NoSubscriber {
|
||||
#[inline]
|
||||
fn register_callsite(&self, _: &'static Metadata<'static>) -> Interest {
|
||||
|
@ -341,7 +341,7 @@ pub(in crate::field) mod test_util {
|
||||
|
||||
impl<'a> Visit for DebugVisitor<'a> {
|
||||
fn record_debug(&mut self, field: &Field, value: &dyn fmt::Debug) {
|
||||
write!(&mut self.writer, "{}={:?}", field, value).unwrap();
|
||||
write!(self.writer, "{}={:?}", field, value).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user