Skip to content

Commit 8af0b4c

Browse files
committed
refactor: elide lifetime of HeaderExtractor & HeaderInjector
1 parent 7757d0c commit 8af0b4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tracing-opentelemetry-instrumentation-sdk/src/http/opentelemetry_http.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use opentelemetry::propagation::{Extractor, Injector};
33
// copy from crate opentelemetry-http (to not be dependants of on 3rd: http, ...)
44
pub struct HeaderInjector<'a>(pub &'a mut http::HeaderMap);
55

6-
impl<'a> Injector for HeaderInjector<'a> {
6+
impl Injector for HeaderInjector<'_> {
77
/// Set a key and value in the `HeaderMap`. Does nothing if the key or value are not valid inputs.
88
fn set(&mut self, key: &str, value: String) {
99
if let Ok(name) = http::header::HeaderName::from_bytes(key.as_bytes()) {
@@ -16,7 +16,7 @@ impl<'a> Injector for HeaderInjector<'a> {
1616

1717
pub struct HeaderExtractor<'a>(pub &'a http::HeaderMap);
1818

19-
impl<'a> Extractor for HeaderExtractor<'a> {
19+
impl Extractor for HeaderExtractor<'_> {
2020
/// Get a value for a key from the `HeaderMap`. If the value is not valid ASCII, returns None.
2121
fn get(&self, key: &str) -> Option<&str> {
2222
self.0.get(key).and_then(|value| value.to_str().ok())

0 commit comments

Comments
 (0)