diff options
Diffstat (limited to 'crates/tor-dirclient')
| -rw-r--r-- | crates/tor-dirclient/Cargo.toml | 1 | ||||
| -rw-r--r-- | crates/tor-dirclient/src/lib.rs | 3 | ||||
| -rw-r--r-- | crates/tor-dirclient/src/request.rs | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/crates/tor-dirclient/Cargo.toml b/crates/tor-dirclient/Cargo.toml index f9dae948b..f04f8ac8c 100644 --- a/crates/tor-dirclient/Cargo.toml +++ b/crates/tor-dirclient/Cargo.toml @@ -64,6 +64,7 @@ tor-netdoc = { path = "../tor-netdoc", version = "0.40.0" } tor-proto = { path = "../tor-proto", version = "0.40.0" } tor-rtcompat = { path = "../tor-rtcompat", version = "0.40.0" } tracing = "0.1.36" +web-time-compat = { path = "../web-time-compat", version = "0.1.0" } [dev-dependencies] futures-await-test = "0.3.0" diff --git a/crates/tor-dirclient/src/lib.rs b/crates/tor-dirclient/src/lib.rs index 5939cc2ba..923423a26 100644 --- a/crates/tor-dirclient/src/lib.rs +++ b/crates/tor-dirclient/src/lib.rs @@ -593,6 +593,7 @@ mod test { use tor_rtmock::io::stream_pair; use tor_rtmock::simple_time::SimpleMockTimeProvider; + use web_time_compat::{SystemTime, SystemTimeExt}; use futures_await_test::async_test; @@ -633,7 +634,7 @@ mod test { // We don't need to do anything fancy here, since we aren't simulating // a timeout. #[allow(deprecated)] // TODO #1885 - let mock_time = SimpleMockTimeProvider::from_wallclock(std::time::SystemTime::now()); + let mock_time = SimpleMockTimeProvider::from_wallclock(SystemTime::get()); let mut output = Vec::new(); let mut stream = match get_decoder(data, encoding, AnonymizedRequest::Direct) { diff --git a/crates/tor-dirclient/src/request.rs b/crates/tor-dirclient/src/request.rs index ab4412a3f..476b86124 100644 --- a/crates/tor-dirclient/src/request.rs +++ b/crates/tor-dirclient/src/request.rs @@ -831,6 +831,7 @@ mod test { //! <!-- @@ end test lint list maintained by maint/add_warning @@ --> use super::sealed::RequestableInner; use super::*; + use web_time_compat::SystemTimeExt; #[test] fn test_md_request() -> Result<()> { @@ -915,7 +916,7 @@ mod test { .unwrap(); let d2 = b"blah blah blah 12 blah blah blah"; - let d3 = SystemTime::now(); + let d3 = SystemTime::get(); let mut req = ConsensusRequest::default(); let when = httpdate::fmt_http_date(d3); |
