@@ -11,19 +11,19 @@ static DEFAULT_TEXT_MAP_PROPAGATOR: OnceLock<NoopTextMapPropagator> = OnceLock::
1111
1212/// Ensures the `GLOBAL_TEXT_MAP_PROPAGATOR` is initialized with a `NoopTextMapPropagator`.
1313#[ inline]
14- fn init_global_text_map_propagator ( ) -> & ' static RwLock < Box < dyn TextMapPropagator + Send + Sync > > {
14+ fn global_text_map_propagator ( ) -> & ' static RwLock < Box < dyn TextMapPropagator + Send + Sync > > {
1515 GLOBAL_TEXT_MAP_PROPAGATOR . get_or_init ( || RwLock :: new ( Box :: new ( NoopTextMapPropagator :: new ( ) ) ) )
1616}
1717
1818/// Ensures the `DEFAULT_TEXT_MAP_PROPAGATOR` is initialized.
1919#[ inline]
20- fn init_default_text_map_propagator ( ) -> & ' static NoopTextMapPropagator {
20+ fn default_text_map_propagator ( ) -> & ' static NoopTextMapPropagator {
2121 DEFAULT_TEXT_MAP_PROPAGATOR . get_or_init ( NoopTextMapPropagator :: new)
2222}
2323
2424/// Sets the given [`TextMapPropagator`] propagator as the current global propagator.
2525pub fn set_text_map_propagator < P : TextMapPropagator + Send + Sync + ' static > ( propagator : P ) {
26- let global_propagator = init_global_text_map_propagator ( ) ;
26+ let global_propagator = global_text_map_propagator ( ) ;
2727 let _lock = global_propagator
2828 . write ( )
2929 . map ( |mut global_propagator| * global_propagator = Box :: new ( propagator) ) ;
@@ -34,12 +34,12 @@ pub fn get_text_map_propagator<T, F>(mut f: F) -> T
3434where
3535 F : FnMut ( & dyn TextMapPropagator ) -> T ,
3636{
37- let global_propagator = init_global_text_map_propagator ( ) ;
37+ let global_propagator = global_text_map_propagator ( ) ;
3838 global_propagator
3939 . read ( )
4040 . map ( |propagator| f ( & * * propagator) )
4141 . unwrap_or_else ( |_| {
42- let default_propagator = init_default_text_map_propagator ( ) ;
42+ let default_propagator = default_text_map_propagator ( ) ;
4343 f ( default_propagator as & dyn TextMapPropagator )
4444 } )
4545}
0 commit comments