5个版本

0.2.0-rc1 2023年6月25日
0.1.2 2023年6月26日
0.1.1 2023年6月25日
0.1.0 2023年6月25日
0.0.0 2023年6月25日

#165进程宏

Download history 14036/week @ 2024-03-13 13214/week @ 2024-03-20 8886/week @ 2024-03-27 13345/week @ 2024-04-03 12558/week @ 2024-04-10 15441/week @ 2024-04-17 14699/week @ 2024-04-24 13521/week @ 2024-05-01 12250/week @ 2024-05-08 16724/week @ 2024-05-15 16390/week @ 2024-05-22 18210/week @ 2024-05-29 14666/week @ 2024-06-05 14406/week @ 2024-06-12 15085/week @ 2024-06-19 17228/week @ 2024-06-26

64,195 每月下载量
10 Crates 中使用 (8 直接使用)

Zlib OR MIT OR Apache-2.0

16KB
116

::cfg_eval

#[cfg_eval] 在稳定版Rust。

Repository Latest version Documentation MSRV unsafe forbidden License CI

示例

use ::macro_rules_attribute::apply;

#[macro_use]
extern crate cfg_eval;

fn main()
{
    let output_without_cfg_eval = {
        #[apply(stringify!)]
        enum Foo {
            Bar,

            #[cfg(FALSE)]
            NonExisting,
        }
    };
    // This is usually not great.
    assert!(output_without_cfg_eval.contains("NonExisting"));

    let output_with_cfg_eval = {
        #[cfg_eval]
        #[apply(stringify!)]
        enum Foo {
            Bar,

            #[cfg(FALSE)]
            NonExisting,
        }
    };
    assert_eq!(output_with_cfg_eval, stringify! {
        enum Foo {
            Bar,
        }
    });
}

依赖项

~280–730KB
~17K SLoC