@@ -165,10 +165,8 @@ pub mod pretty {
165165 let mut out = Vec :: < u8 > :: new ( ) ;
166166 let mut err = Vec :: < u8 > :: new ( ) ;
167167
168- let span = gix:: trace:: coarse!( "run" ) ;
169- let res = run ( progress:: DoOrDiscard :: from ( Some ( sub_progress) ) , & mut out, & mut err) ;
170- #[ cfg( feature = "tracing" ) ]
171- drop ( span) ;
168+ let res = gix:: trace:: coarse!( "run" )
169+ . into_scope ( || run ( progress:: DoOrDiscard :: from ( Some ( sub_progress) ) , & mut out, & mut err) ) ;
172170
173171 handle. shutdown_and_wait ( ) ;
174172 std:: io:: Write :: write_all ( & mut stdout ( ) , & out) ?;
@@ -219,10 +217,9 @@ pub mod pretty {
219217 // We might have something interesting to show, which would be hidden by the alternate screen if there is a progress TUI
220218 // We know that the printing happens at the end, so this is fine.
221219 let mut out = Vec :: new ( ) ;
222- let span = gix:: trace:: coarse!( "run" , name = name) ;
223- let res = run ( progress:: DoOrDiscard :: from ( Some ( sub_progress) ) , & mut out, & mut stderr ( ) ) ;
224- #[ cfg( feature = "tracing" ) ]
225- drop ( span) ;
220+ let res = gix:: trace:: coarse!( "run" , name = name) . into_scope ( || {
221+ run ( progress:: DoOrDiscard :: from ( Some ( sub_progress) ) , & mut out, & mut stderr ( ) )
222+ } ) ;
226223 tx. send ( Event :: ComputationDone ( res, out) ) . ok ( ) ;
227224 }
228225 } ) ;
0 commit comments