#编译 #编译的 #抛出 #配置文件 #动作 #错误 #

已删除 noship

Noship 是一个宏,其行为类似于 todo!,但在发布配置文件编译时将抛出编译错误。

0.1.1 2020 年 9 月 29 日
0.1.0 2020 年 9 月 26 日
0.0.1 2020 年 9 月 24 日

#11 in #acts

MIT/Apache

10KB

Noship

Build crates.io Docs

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-2.0 许可证定义的,你故意提交的包含在工作中的任何贡献,将根据上述许可证双重许可,而无需任何附加条款或条件。

无运行时依赖