Skip to content

Commit

Permalink
core: derive Default for NoSubscriber (tokio-rs#1785)
Browse files Browse the repository at this point in the history
* core: derive `Default` for `NoSubscriber`
* additional clippy nonsense

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
hawkw authored and kaffarell committed May 22, 2024
1 parent c5ab1f2 commit 58c0f19
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions tracing-core/src/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 58c0f19

Please sign in to comment.