diff --git a/Cargo.toml b/Cargo.toml index 702387f..e2282b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pledge" -version = "0.2.0" +version = "0.2.2" authors = ["Andrew Aldridge "] description = "Rust binding to OpenBSD's pledge(2) interface" readme = "README.md" diff --git a/src/lib.rs b/src/lib.rs index 485f401..6046e30 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -78,7 +78,7 @@ impl Promise { } } -trait ToPromiseString { +pub trait ToPromiseString { fn to_promise_string(&self) -> String; } @@ -113,7 +113,12 @@ pub fn pledge(promises: &str) -> Result<(), Error> { macro_rules! pledge { ( $( $x:ident ),* ) => { { - use ToPromiseString; + #[cfg(not(test))] + use pledge::{Promise, ToPromiseString}; + + #[cfg(test)] + use {Promise, ToPromiseString}; + let mut promises = Vec::new(); $( promises.push(Promise::$x);