redefine crate to use Error everywhere except in wasi
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::wasi::types::{Subclockflags, SubscriptionClock};
|
||||
use crate::wasi::{Errno, Result};
|
||||
use crate::{Error, Result};
|
||||
use std::time::SystemTime;
|
||||
|
||||
pub(crate) use super::sys_impl::clock::*;
|
||||
@@ -10,7 +10,7 @@ pub(crate) fn to_relative_ns_delay(clock: &SubscriptionClock) -> Result<u128> {
|
||||
}
|
||||
let now: u128 = SystemTime::now()
|
||||
.duration_since(SystemTime::UNIX_EPOCH)
|
||||
.map_err(|_| Errno::Notcapable)?
|
||||
.map_err(|_| Error::Notcapable)?
|
||||
.as_nanos();
|
||||
let deadline = u128::from(clock.timeout);
|
||||
Ok(deadline.saturating_sub(now))
|
||||
|
||||
Reference in New Issue
Block a user