tiaojian-macro

Crates.iotiaojian-macro
lib.rstiaojian-macro
version0.4.1
sourcesrc
created_at2023-11-11 04:15:24.479419
updated_at2023-11-20 13:56:54.834579
descriptiontiaojian-macro is a conditional compile proc-macro
homepage
repositoryhttps://github.com/evanzp0/tiaojian
max_upload_size
id1031850
size17,599
(evanzp0)

documentation

https://docs.rs/tiaojian-macro

README

About tiaojian-macro

tiaojian-macro 是使用过程宏进行条件编译的工具包,目前实现了项目中已激活的 package 的检测。

Example

#![feature(proc_macro_hygiene)]

use tiaojian_macro::tiaojian;

fn main() {
    #[tiaojian(is_active("sqlx", "sqlx-mysql"))]
    println!("sqlx and sqlx-mysql are actived");

    #[tiaojian(is_active("sqlx", "sqlx-sqlite"))]
    println!("sqlx and sqlx-sqlite are actived");
}
Commit count: 17

cargo fmt