5个版本
0.2.0-rc1 |
|
---|---|
0.1.2 | 2023年6月26日 |
0.1.1 | 2023年6月25日 |
0.1.0 |
|
0.0.0 | 2023年6月25日 |
#165 在 进程宏
64,195 每月下载量
在 10 个 Crates 中使用 (8 直接使用)
16KB
116 行
::cfg_eval
#[cfg_eval]
在稳定版Rust。
示例
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