We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f9f96d commit d398164Copy full SHA for d398164
src/lib.rs
@@ -307,14 +307,10 @@ where
307
let mut event_buf = &mut bufs.current_buf;
308
309
// printing the indentation
310
- let indent = if ctx.current_span().id().is_some() {
311
- // size hint isn't implemented on Scope.
312
- ctx.event_scope(event)
313
- .expect("Unable to get span scope; this is a bug")
314
- .count()
315
- } else {
316
- 0
317
- };
+ let indent = ctx
+ .event_scope(event)
+ .map(|scope| scope.count())
+ .unwrap_or(0);
318
319
// check if this event occurred in the context of a span.
320
// if it has, get the start time of this span.
0 commit comments