1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use TokenStream;
/// Proc macro to remove code when not debug build.
/// ```rust
/// debug! {
/// struct Test {
/// pub i: i32,
/// }
/// }
/// ```
/// In above case, struct `Test` will be removed when not debug build.
// proc_macro_attribute don't support helper attributes
// So use proc_macro instead.
/// Remove the `field` or `variant` with `#[debug]` attribute Struct, Enum or Union.
/// ```rust
/// debug_fields! {
/// struct Test {
/// x: i32,
/// #[debug]
/// y: i32,
/// }
/// }
/// ```
/// In above case, field `y` will be removed when not debug build.