added nix feature to hs
This commit is contained in:
+2
-1
@@ -8,7 +8,8 @@ path = "src/hs.rs"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
std = ["dep:sysinfo", "dep:watchdog-device"]
|
std = ["dep:sysinfo"]
|
||||||
|
nix = ["dep:watchdog-device"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rfe = { path = "../../rfe" }
|
rfe = { path = "../../rfe" }
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ pub trait Watchdog {
|
|||||||
fn feed(&mut self);
|
fn feed(&mut self);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(all(feature = "std", feature = "nix"))]
|
||||||
mod watchdog_std {
|
mod watchdog_nix {
|
||||||
use super::Watchdog;
|
use super::Watchdog;
|
||||||
extern crate std;
|
extern crate std;
|
||||||
use crate::unwrap_print_err;
|
use crate::unwrap_print_err;
|
||||||
@@ -52,8 +52,8 @@ mod watchdog_std {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(all(feature = "std", feature = "nix"))]
|
||||||
pub use watchdog_std::*;
|
pub use watchdog_nix::*;
|
||||||
|
|
||||||
pub type WatchdogRef<'a> = Option<&'a mut dyn Watchdog>;
|
pub type WatchdogRef<'a> = Option<&'a mut dyn Watchdog>;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user