Skip to content

Commit

Permalink
review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb committed Feb 15, 2024
1 parent 6b57068 commit cc50ea4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions opentelemetry-sdk/src/resource/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,16 @@ impl Resource {
} else {
Some(schema_url_str)
};

let mut resource = Self::new(kvs);
let new_inner = ResourceInner {
attrs: Arc::make_mut(&mut resource.inner).attrs.clone(),
schema_url: normalized_schema_url,
};

resource.inner = Arc::new(new_inner);

resource
let mut attrs = HashMap::new();
for kv in kvs {
attrs.insert(kv.key, kv.value);
}
Resource {
inner: Arc::new(ResourceInner {
attrs,
schema_url: normalized_schema_url,
}),
}
}

/// Create a new `Resource` from resource detectors.
Expand Down

0 comments on commit cc50ea4

Please sign in to comment.