mirror of
https://github.com/tokio-rs/tracing.git
synced 2025-10-02 23:34:40 +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,
|
/// [`NoSubscriber`] implements the [`Subscriber`] trait by never being enabled,
|
||||||
/// never being interested in any callsite, and dropping all spans and events.
|
/// never being interested in any callsite, and dropping all spans and events.
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
pub struct NoSubscriber(());
|
pub struct NoSubscriber(());
|
||||||
|
|
||||||
impl Default for NoSubscriber {
|
|
||||||
fn default() -> Self {
|
|
||||||
NoSubscriber(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Subscriber for NoSubscriber {
|
impl Subscriber for NoSubscriber {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn register_callsite(&self, _: &'static Metadata<'static>) -> Interest {
|
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> {
|
impl<'a> Visit for DebugVisitor<'a> {
|
||||||
fn record_debug(&mut self, field: &Field, value: &dyn fmt::Debug) {
|
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