Skip to content

Commit 0172924

Browse files
committed
cargo fmt
1 parent 35d5ede commit 0172924

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

opentelemetry-sdk/src/trace/mod.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,21 @@ mod tests {
148148

149149
// Verify: on_start stored the baggage as an attribute
150150
assert!(
151-
span.attributes.iter().any(|kv| kv.key.as_str() == "bag-key"),
151+
span.attributes
152+
.iter()
153+
.any(|kv| kv.key.as_str() == "bag-key"),
152154
"Baggage should have been stored as span attribute in on_start"
153155
);
154156

155157
// The current context's baggage is the parent's baggage (if any)
156-
println!("on_end: parent context baggage = {:?}",
157-
current_cx.baggage().iter().map(|(k, _)| k).collect::<Vec<_>>());
158+
println!(
159+
"on_end: parent context baggage = {:?}",
160+
current_cx
161+
.baggage()
162+
.iter()
163+
.map(|(k, _)| k)
164+
.collect::<Vec<_>>()
165+
);
158166
}
159167

160168
fn force_flush(&self) -> crate::error::OTelSdkResult {

opentelemetry/src/context.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,8 @@ impl Drop for ContextGuard {
480480
if id > ContextStack::BASE_POS && id < ContextStack::MAX_POS {
481481
// Extract the context to drop outside of borrow_mut to avoid panic
482482
// when the context's drop implementation (e.g., Span::drop) calls Context::current()
483-
let _context_to_drop = CURRENT_CONTEXT.with(|context_stack| {
484-
context_stack.borrow_mut().pop_id(id)
485-
});
483+
let _context_to_drop =
484+
CURRENT_CONTEXT.with(|context_stack| context_stack.borrow_mut().pop_id(id));
486485
// Context is automatically dropped here, outside of borrow_mut scope
487486
}
488487
}

0 commit comments

Comments
 (0)