Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions tracing-subscriber/src/registry/sharded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,21 +287,15 @@ impl Collect 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) {
dispatch::get_default(|dispatch| dispatch.try_close(id.clone()));
}
spans.borrow_mut().pop(id);
}
}

Expand Down
3 changes: 1 addition & 2 deletions tracing-subscriber/src/registry/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,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]
Expand Down
Loading