@@ -181,7 +181,7 @@ use tower_layer::Layer;
181181use tower_service:: Service ;
182182use uuid:: Uuid ;
183183
184- pub ( crate ) const X_REQUEST_ID : & str = "x-request-id" ;
184+ pub ( crate ) const X_REQUEST_ID : HeaderName = HeaderName :: from_static ( "x-request-id" ) ;
185185
186186/// Trait for producing [`RequestId`]s.
187187///
@@ -246,7 +246,7 @@ impl<M> SetRequestIdLayer<M> {
246246 where
247247 M : MakeRequestId ,
248248 {
249- SetRequestIdLayer :: new ( HeaderName :: from_static ( X_REQUEST_ID ) , make_request_id)
249+ SetRequestIdLayer :: new ( X_REQUEST_ID , make_request_id)
250250 }
251251}
252252
@@ -299,11 +299,7 @@ impl<S, M> SetRequestId<S, M> {
299299 where
300300 M : MakeRequestId ,
301301 {
302- Self :: new (
303- inner,
304- HeaderName :: from_static ( X_REQUEST_ID ) ,
305- make_request_id,
306- )
302+ Self :: new ( inner, X_REQUEST_ID , make_request_id)
307303 }
308304
309305 define_inner_service_accessors ! ( ) ;
@@ -365,7 +361,7 @@ impl PropagateRequestIdLayer {
365361
366362 /// Create a new `PropagateRequestIdLayer` that uses `x-request-id` as the header name.
367363 pub fn x_request_id ( ) -> Self {
368- Self :: new ( HeaderName :: from_static ( X_REQUEST_ID ) )
364+ Self :: new ( X_REQUEST_ID )
369365 }
370366}
371367
@@ -397,7 +393,7 @@ impl<S> PropagateRequestId<S> {
397393
398394 /// Create a new `PropagateRequestId` that uses `x-request-id` as the header name.
399395 pub fn x_request_id ( inner : S ) -> Self {
400- Self :: new ( inner, HeaderName :: from_static ( X_REQUEST_ID ) )
396+ Self :: new ( inner, X_REQUEST_ID )
401397 }
402398
403399 define_inner_service_accessors ! ( ) ;
0 commit comments