Skip to content

Commit 417f990

Browse files
committed
remove span clone on enter
1 parent e66e6d9 commit 417f990

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

tracing-subscriber/src/registry/sharded.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -287,21 +287,15 @@ impl Collect for Registry {
287287
fn event(&self, _: &Event<'_>) {}
288288

289289
fn enter(&self, id: &span::Id) {
290-
if self
291-
.current_spans
290+
self.current_spans
292291
.get_or_default()
293292
.borrow_mut()
294-
.push(id.clone())
295-
{
296-
self.clone_span(id);
297-
}
293+
.push(id.clone());
298294
}
299295

300296
fn exit(&self, id: &span::Id) {
301297
if let Some(spans) = self.current_spans.get() {
302-
if spans.borrow_mut().pop(id) {
303-
dispatch::get_default(|dispatch| dispatch.try_close(id.clone()));
304-
}
298+
spans.borrow_mut().pop(id);
305299
}
306300
}
307301

tracing-subscriber/src/registry/stack.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ pub(crate) struct SpanStack {
1717

1818
impl SpanStack {
1919
#[inline]
20-
pub(super) fn push(&mut self, id: Id) -> bool {
20+
pub(super) fn push(&mut self, id: Id) {
2121
let duplicate = self.stack.iter().any(|i| i.id == id);
2222
self.stack.push(ContextId { id, duplicate });
23-
!duplicate
2423
}
2524

2625
#[inline]

0 commit comments

Comments
 (0)