added nix feature to hs

This commit is contained in:
2024-12-14 20:36:51 -06:00
parent 19a0cc1a8e
commit 282531ee81
2 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -8,7 +8,8 @@ path = "src/hs.rs"
[features]
default = []
std = ["dep:sysinfo", "dep:watchdog-device"]
std = ["dep:sysinfo"]
nix = ["dep:watchdog-device"]
[dependencies]
rfe = { path = "../../rfe" }
+4 -4
View File
@@ -5,8 +5,8 @@ pub trait Watchdog {
fn feed(&mut self);
}
#[cfg(feature = "std")]
mod watchdog_std {
#[cfg(all(feature = "std", feature = "nix"))]
mod watchdog_nix {
use super::Watchdog;
extern crate std;
use crate::unwrap_print_err;
@@ -52,8 +52,8 @@ mod watchdog_std {
}
}
#[cfg(feature = "std")]
pub use watchdog_std::*;
#[cfg(all(feature = "std", feature = "nix"))]
pub use watchdog_nix::*;
pub type WatchdogRef<'a> = Option<&'a mut dyn Watchdog>;