diff options
Diffstat (limited to 'crates/arti-client/src/builder.rs')
| -rw-r--r-- | crates/arti-client/src/builder.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/arti-client/src/builder.rs b/crates/arti-client/src/builder.rs index 0fea83741..2520658d3 100644 --- a/crates/arti-client/src/builder.rs +++ b/crates/arti-client/src/builder.rs @@ -5,15 +5,12 @@ use crate::{ BootstrapBehavior, InertTorClient, Result, TorClient, TorClientConfig, err::ErrorDetail, }; -use std::{ - result::Result as StdResult, - sync::Arc, - time::{Duration, Instant}, -}; +use std::{result::Result as StdResult, sync::Arc}; use tor_dirmgr::{DirMgrConfig, DirMgrStore}; use tor_error::{ErrorKind, HasKind as _}; use tor_rtcompat::Runtime; use tracing::instrument; +use web_time_compat::{Duration, Instant, InstantExt}; /// An object that knows how to construct some kind of DirProvider. /// @@ -187,11 +184,11 @@ impl<R: Runtime> TorClientBuilder<R> { #[instrument(skip_all, level = "trace")] pub fn create_unbootstrapped(&self) -> Result<TorClient<R>> { let timeout = self.local_resource_timeout_or(Duration::from_millis(0))?; - let give_up_at = Instant::now() + timeout; + let give_up_at = Instant::get() + timeout; let mut first_attempt = true; loop { - match self.create_unbootstrapped_inner(Instant::now, give_up_at, first_attempt) { + match self.create_unbootstrapped_inner(Instant::get, give_up_at, first_attempt) { Err(delay) => { first_attempt = false; std::thread::sleep(delay); |
