chore(deps): replace instant with web-time (#1830)

* chore(deps): replace `instant` with `web-time`

Close https://github.com/paritytech/subxt/issues/1597

* fix build

* fix build v2

* cargo fmt
This commit is contained in:
Niklas Adolfsson
2024-10-22 15:54:54 +02:00
committed by GitHub
parent c07c760d85
commit 418bd88e62
6 changed files with 21 additions and 24 deletions
+4 -4
View File
@@ -11,17 +11,17 @@ use core::time::Duration;
use futures_util::{future, FutureExt};
pub fn now_from_unix_epoch() -> Duration {
instant::SystemTime::now()
.duration_since(instant::SystemTime::UNIX_EPOCH)
web_time::SystemTime::now()
.duration_since(web_time::SystemTime::UNIX_EPOCH)
.unwrap_or_else(|_| {
panic!("Invalid systime cannot be configured earlier than `UNIX_EPOCH`")
})
}
pub type Instant = instant::Instant;
pub type Instant = web_time::Instant;
pub fn now() -> Instant {
instant::Instant::now()
web_time::Instant::now()
}
pub type Delay = future::BoxFuture<'static, ()>;