Skip to content

Commit

Permalink
feat: use let else instead of unwrap (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
YangNianYi authored Dec 13, 2023
1 parent 62690b4 commit b982144
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ impl PreSampledTracer for noop::NoopTracer {
impl PreSampledTracer for SdkTracer {
fn sampled_context(&self, data: &mut crate::OtelData) -> OtelContext {
// Ensure tracing pipeline is still installed.
if self.provider().is_none() {
let Some(provider) = self.provider() else {
return OtelContext::new();
}
let provider = self.provider().unwrap();
};
let parent_cx = &data.parent_cx;
let builder = &mut data.builder;

Expand Down

0 comments on commit b982144

Please sign in to comment.