0.1.1 |
|
---|---|
0.1.0 |
|
0.0.1 |
|
#11 in #acts
10KB
Noship
Noship 是一个宏,其行为类似于 todo!,但在发布配置文件编译时将抛出编译错误。
这可以看作是 todo,但它在发布模式下拒绝编译,因此在你忘记它的情况下禁止发布不完整的代码。
用法
// src/main.rs
use noship::noship;
fn main() {
let raining = false;
if raining {
noship!();
} else {
println!("going out...");
}
}
$ cargo run
going out...
$ cargo run --release
error: release blocked
--> src/main.rs:7:9
|
7 | noship!();
| ^^^^^^^^^^
|
许可证 & 贡献
在以下任一许可证下发布:
- Apache License,版本 2.0 (LICENSE-APACHE 或 https://apache.ac.cn/licenses/LICENSE-2.0)
- MIT 许可证 (LICENSE-MIT 或 https://open-source.org.cn/licenses/MIT)
由你选择。
除非你明确声明,否则根据 Apache-2.0 许可证定义的,你故意提交的包含在工作中的任何贡献,将根据上述许可证双重许可,而无需任何附加条款或条件。