added nix feature to hs
This commit is contained in:
+2
-1
@@ -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" }
|
||||
|
||||
@@ -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>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user