cfg-or-panic 0.2.0

Replace function bodies with `unimplemented!()` when condition is not met.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use cfg_or_panic::cfg_or_panic;

#[cfg_or_panic(foo)]
fn add(a: i32, b: i32) -> i32 {
    a + b
}

#[test]
#[cfg_attr(not(foo), should_panic)]
fn test() {
    assert_eq!(add(1, 2), 3);
}