Don't use wasm-bindgen on wasi

This commit is contained in:
Pierre Krieger 2019-10-10 22:25:47 +02:00
parent 366b800318
commit 10a791e323
No known key found for this signature in database
GPG Key ID: EE749C4F41D4EA47
5 changed files with 10 additions and 10 deletions

View File

@ -2,7 +2,7 @@
name = "wasm-timer"
edition = "2018"
description = "Abstraction over std::time::Instant and futures-timer that works on WASM"
version = "0.2.1"
version = "0.2.2"
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
license = "MIT"
repository = "https://github.com/tomaka/wasm-timer"
@ -12,7 +12,7 @@ futures-preview = "0.3.0-alpha"
parking_lot = "0.9"
pin-utils = "0.1.0-alpha.4"
[target.'cfg(any(target_arch = "wasm32"))'.dependencies]
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
js-sys = "0.3.14"
send_wrapper = "0.2"
wasm-bindgen = { version = "0.2.37" }

View File

@ -20,11 +20,11 @@
pub use timer::*;
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
pub use std::time::{Instant, SystemTime, UNIX_EPOCH};
#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
pub use wasm::*;
mod timer;
#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
mod wasm;

View File

@ -537,7 +537,7 @@ impl TimerHandle {
}
impl Default for TimerHandle {
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
fn default() -> TimerHandle {
let mut fallback = HANDLE_FALLBACK.load(SeqCst);
@ -579,7 +579,7 @@ impl Default for TimerHandle {
}
}
#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
fn default() -> TimerHandle {
let mut fallback = HANDLE_FALLBACK.load(SeqCst);

View File

@ -1,8 +1,8 @@
pub(crate) use self::platform::*;
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
#[path = "global/desktop.rs"]
mod platform;
#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
#[path = "global/wasm.rs"]
mod platform;

View File

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
#![cfg(target_arch = "wasm32")]
#![cfg(all(target_arch = "wasm32", target_os = "unknown"))]
use std::cmp::{Eq, PartialEq, Ord, PartialOrd, Ordering};
use std::ops::{Add, Sub, AddAssign, SubAssign};