fixed no_std
This commit is contained in:
parent
11686b1667
commit
33654dbf04
@ -89,10 +89,10 @@ use std::{
|
||||
},
|
||||
};
|
||||
|
||||
#[cfg(all(feature = "std", unix))]
|
||||
#[cfg(all(unix, feature = "std"))]
|
||||
use libc::c_char;
|
||||
|
||||
#[cfg(unix)]
|
||||
#[cfg(all(unix, feature = "std"))]
|
||||
use uds::{UnixListenerExt, UnixSocketAddr, UnixStreamExt};
|
||||
|
||||
#[cfg(unix)]
|
||||
|
@ -10,8 +10,8 @@ use crate::{
|
||||
Error,
|
||||
};
|
||||
|
||||
use alloc::string::ToString;
|
||||
use core::{marker::PhantomData, time::Duration};
|
||||
use std::ops::Sub;
|
||||
|
||||
/// Send a stats update all 6 (or more) seconds
|
||||
const STATS_TIMEOUT_DEFAULT: Duration = Duration::from_millis(6 * 1000);
|
||||
@ -161,7 +161,7 @@ where
|
||||
stats_timeout: Duration,
|
||||
) -> Result<Duration, Error> {
|
||||
let cur = current_time();
|
||||
if cur.sub(last) > stats_timeout {
|
||||
if cur - last > stats_timeout {
|
||||
//println!("Fire {:?} {:?} {:?}", cur, last, stats_timeout);
|
||||
manager.fire(
|
||||
state,
|
||||
|
@ -206,6 +206,7 @@ mod tests {
|
||||
#[cfg(feature = "std")]
|
||||
use std::fs;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use super::Tokens;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
|
@ -1,4 +1,7 @@
|
||||
use alloc::string::{String, ToString};
|
||||
use alloc::{
|
||||
string::{String, ToString},
|
||||
vec::Vec,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
|
Loading…
x
Reference in New Issue
Block a user