fix wasm
This commit is contained in:
@@ -23,8 +23,9 @@ impl<T> MustJoinHandle<T> {
|
||||
} else if #[cfg(feature="rt-tokio")] {
|
||||
self.join_handle = None;
|
||||
} else if #[cfg(target_arch = "wasm32")] {
|
||||
self.join_handle.take().detach();
|
||||
self.completed = true;
|
||||
if let Some(jh) = self.join_handle.take() {
|
||||
jh.detach();
|
||||
}
|
||||
} else {
|
||||
compile_error!("needs executor implementation")
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ use super::*;
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(target_arch = "wasm32")] {
|
||||
use futures_util::future::{select, Either};
|
||||
|
||||
pub async fn timeout<F, T>(dur_ms: u32, f: F) -> Result<T, TimeoutError>
|
||||
where
|
||||
|
@@ -14,8 +14,9 @@ cfg_if! {
|
||||
|
||||
pub fn debug_ts(ts: u64) -> String {
|
||||
if is_browser() {
|
||||
let mut now = Date::now();
|
||||
let mut date = Date::new_0();
|
||||
let now = Date::new_0();
|
||||
now.set_time(Date::now());
|
||||
let date = Date::new_0();
|
||||
date.set_time((ts / 1000u64) as f64);
|
||||
|
||||
let show_year = now.get_utc_full_year() != date.get_utc_full_year();
|
||||
|
Reference in New Issue
Block a user