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:
Eliza Weisman 2021-12-16 16:40:07 -08:00 committed by GitHub
parent 6d9da940ff
commit e080a03c5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View File

@ -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 {

View File

@ -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();
}
}