fixed no_std

This commit is contained in:
Dominik Maier 2021-03-22 15:09:47 +01:00
parent 11686b1667
commit 33654dbf04
4 changed files with 9 additions and 5 deletions

View File

@ -89,10 +89,10 @@ use std::{
}, },
}; };
#[cfg(all(feature = "std", unix))] #[cfg(all(unix, feature = "std"))]
use libc::c_char; use libc::c_char;
#[cfg(unix)] #[cfg(all(unix, feature = "std"))]
use uds::{UnixListenerExt, UnixSocketAddr, UnixStreamExt}; use uds::{UnixListenerExt, UnixSocketAddr, UnixStreamExt};
#[cfg(unix)] #[cfg(unix)]

View File

@ -10,8 +10,8 @@ use crate::{
Error, Error,
}; };
use alloc::string::ToString;
use core::{marker::PhantomData, time::Duration}; use core::{marker::PhantomData, time::Duration};
use std::ops::Sub;
/// Send a stats update all 6 (or more) seconds /// Send a stats update all 6 (or more) seconds
const STATS_TIMEOUT_DEFAULT: Duration = Duration::from_millis(6 * 1000); const STATS_TIMEOUT_DEFAULT: Duration = Duration::from_millis(6 * 1000);
@ -161,7 +161,7 @@ where
stats_timeout: Duration, stats_timeout: Duration,
) -> Result<Duration, Error> { ) -> Result<Duration, Error> {
let cur = current_time(); let cur = current_time();
if cur.sub(last) > stats_timeout { if cur - last > stats_timeout {
//println!("Fire {:?} {:?} {:?}", cur, last, stats_timeout); //println!("Fire {:?} {:?} {:?}", cur, last, stats_timeout);
manager.fire( manager.fire(
state, state,

View File

@ -206,6 +206,7 @@ mod tests {
#[cfg(feature = "std")] #[cfg(feature = "std")]
use std::fs; use std::fs;
#[cfg(feature = "std")]
use super::Tokens; use super::Tokens;
#[cfg(feature = "std")] #[cfg(feature = "std")]

View File

@ -1,4 +1,7 @@
use alloc::string::{String, ToString}; use alloc::{
string::{String, ToString},
vec::Vec,
};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::{ use crate::{