File tree Expand file tree Collapse file tree 2 files changed +9
-23
lines changed Expand file tree Collapse file tree 2 files changed +9
-23
lines changed Original file line number Diff line number Diff line change @@ -116,20 +116,20 @@ pub use filter::EnvFilter;
116
116
117
117
pub use layer:: Layer ;
118
118
119
- cfg_fmt ! {
119
+ cfg_feature ! ( "fmt" , {
120
120
pub mod fmt;
121
- pub use fmt:: Subscriber as FmtSubscriber ;
122
121
pub use fmt:: fmt;
123
- }
122
+ pub use fmt:: Subscriber as FmtSubscriber ;
123
+ } ) ;
124
124
125
- cfg_registry ! {
125
+ cfg_feature ! ( "registry" , {
126
126
pub use registry:: Registry ;
127
127
128
128
///
129
129
pub fn registry( ) -> Registry {
130
130
Registry :: default ( )
131
131
}
132
- }
132
+ } ) ;
133
133
134
134
use std:: default:: Default ;
135
135
/// Tracks the currently executing span on a per-thread basis.
Original file line number Diff line number Diff line change @@ -13,25 +13,11 @@ macro_rules! try_lock {
13
13
} ;
14
14
}
15
15
16
- /// Declares fmt items.
17
- #[ doc( hidden) ]
18
- macro_rules! cfg_fmt {
19
- ( $( $item: item) * ) => {
16
+ macro_rules! cfg_feature {
17
+ ( $name: expr, { $( $item: item) * } ) => {
20
18
$(
21
- #[ cfg( feature = "fmt" ) ]
22
- #[ cfg_attr( docsrs, doc( cfg( feature = "fmt" ) ) ) ]
23
- $item
24
- ) *
25
- }
26
- }
27
-
28
- /// Declares registry items.
29
- #[ doc( hidden) ]
30
- macro_rules! cfg_registry {
31
- ( $( $item: item) * ) => {
32
- $(
33
- #[ cfg( feature = "registry" ) ]
34
- #[ cfg_attr( docsrs, doc( cfg( feature = "registry" ) ) ) ]
19
+ #[ cfg( feature = $name) ]
20
+ #[ cfg_attr( docsrs, doc( cfg( feature = $name) ) ) ]
35
21
$item
36
22
) *
37
23
}
You can’t perform that action at this time.
0 commit comments