Skip to content

Commit

Permalink
chore: remove unwrap from "sleep"
Browse files Browse the repository at this point in the history
  • Loading branch information
jkomyno committed Nov 30, 2023
1 parent 57ce977 commit 4d92a88
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions libs/crosstarget-utils/src/wasm/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ impl ElapsedTimeCounter {
}

pub async fn sleep(duration: Duration) {
JsFuture::from(Promise::new(&mut |resolve, _reject| {
let _ = JsFuture::from(Promise::new(&mut |resolve, _reject| {
set_timeout(&resolve, duration.as_millis() as u32);
}))
.await
// TODO:
.unwrap();
.await;
}

pub async fn timeout<F>(duration: Duration, future: F) -> Result<F::Output, TimeoutError>
Expand Down

0 comments on commit 4d92a88

Please sign in to comment.