diff --git a/tracing-subscriber/src/registry/sharded.rs b/tracing-subscriber/src/registry/sharded.rs index df054148f..806f0fbda 100644 --- a/tracing-subscriber/src/registry/sharded.rs +++ b/tracing-subscriber/src/registry/sharded.rs @@ -288,21 +288,15 @@ impl Subscriber for Registry { fn event(&self, _: &Event<'_>) {} fn enter(&self, id: &span::Id) { - if self - .current_spans + self.current_spans .get_or_default() .borrow_mut() - .push(id.clone()) - { - self.clone_span(id); - } + .push(id.clone()); } fn exit(&self, id: &span::Id) { if let Some(spans) = self.current_spans.get() { - if spans.borrow_mut().pop(id) { - self.try_close(id.clone()); - } + spans.borrow_mut().pop(id); } } diff --git a/tracing-subscriber/src/registry/stack.rs b/tracing-subscriber/src/registry/stack.rs index 2e682519a..3c32ef169 100644 --- a/tracing-subscriber/src/registry/stack.rs +++ b/tracing-subscriber/src/registry/stack.rs @@ -18,10 +18,9 @@ pub(crate) struct SpanStack { impl SpanStack { #[inline] - pub(super) fn push(&mut self, id: Id) -> bool { + pub(super) fn push(&mut self, id: Id) { let duplicate = self.stack.iter().any(|i| i.id == id); self.stack.push(ContextId { id, duplicate }); - !duplicate } #[inline]