From bd6e3d7682d122997f8d3543eb87a62121ef0669 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 17 Jun 2023 10:06:26 +0200 Subject: [PATCH] adapt to changes in `gix-trace` --- src/shared.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/shared.rs b/src/shared.rs index fb0ed271413..8b5e640a4fe 100644 --- a/src/shared.rs +++ b/src/shared.rs @@ -165,10 +165,8 @@ pub mod pretty { let mut out = Vec::::new(); let mut err = Vec::::new(); - let span = gix::trace::coarse!("run"); - let res = run(progress::DoOrDiscard::from(Some(sub_progress)), &mut out, &mut err); - #[cfg(feature = "tracing")] - drop(span); + let res = gix::trace::coarse!("run") + .into_scope(|| run(progress::DoOrDiscard::from(Some(sub_progress)), &mut out, &mut err)); handle.shutdown_and_wait(); std::io::Write::write_all(&mut stdout(), &out)?; @@ -219,10 +217,9 @@ pub mod pretty { // We might have something interesting to show, which would be hidden by the alternate screen if there is a progress TUI // We know that the printing happens at the end, so this is fine. let mut out = Vec::new(); - let span = gix::trace::coarse!("run", name = name); - let res = run(progress::DoOrDiscard::from(Some(sub_progress)), &mut out, &mut stderr()); - #[cfg(feature = "tracing")] - drop(span); + let res = gix::trace::coarse!("run", name = name).into_scope(|| { + run(progress::DoOrDiscard::from(Some(sub_progress)), &mut out, &mut stderr()) + }); tx.send(Event::ComputationDone(res, out)).ok(); } });