1
0
mirror of https://github.com/bspeice/qadapt synced 2025-07-02 06:16:30 -04:00

Add an is_active function, and remove panic on not using

This commit is contained in:
2019-01-20 13:19:02 -05:00
parent 9605206b26
commit 8838070a1b
4 changed files with 94 additions and 29 deletions

4
tests/inactive.rs Normal file
View File

@ -0,0 +1,4 @@
#[test]
fn is_inactive() {
assert!(!qadapt::is_active());
}

View File

@ -1,11 +0,0 @@
use qadapt::enter_protected;
#[test]
#[should_panic]
fn guard_without_initialization() {
if cfg!(debug_assertions) {
enter_protected();
} else {
panic!("Intentional")
}
}