diff --git a/reqwest-middleware/CHANGELOG.md b/reqwest-middleware/CHANGELOG.md index cfb2b91..69bed59 100644 --- a/reqwest-middleware/CHANGELOG.md +++ b/reqwest-middleware/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Updated `wasm-timer` to `wasmtimer` + ## [0.4.0] - 2024-11-08 ### Breaking Changes diff --git a/reqwest-retry/Cargo.toml b/reqwest-retry/Cargo.toml index e29ed3d..9ebfd12 100644 --- a/reqwest-retry/Cargo.toml +++ b/reqwest-retry/Cargo.toml @@ -30,8 +30,7 @@ hyper = "1.0" tokio = { version = "1.6.0", default-features = false, features = ["time"] } [target.'cfg(target_arch = "wasm32")'.dependencies] -parking_lot = { version = "0.11.2", features = ["wasm-bindgen"] } # work around https://github.com/tomaka/wasm-timer/issues/14 -wasm-timer = "0.2.5" +wasmtimer = "0.4.1" getrandom = { version = "0.2.0", features = ["js"] } [dev-dependencies] diff --git a/reqwest-retry/src/middleware.rs b/reqwest-retry/src/middleware.rs index 541e83c..a8339c1 100644 --- a/reqwest-retry/src/middleware.rs +++ b/reqwest-retry/src/middleware.rs @@ -177,9 +177,7 @@ where #[cfg(not(target_arch = "wasm32"))] tokio::time::sleep(duration).await; #[cfg(target_arch = "wasm32")] - wasm_timer::Delay::new(duration) - .await - .expect("failed sleeping"); + wasmtimer::tokio::sleep(duration).await; n_past_retries += 1; continue;