Only use wasm-bindgen with unknown OS

This commit is contained in:
Pierre Krieger 2019-10-10 22:23:40 +02:00
parent fd76bd4282
commit 6fa4d915fe
No known key found for this signature in database
GPG Key ID: EE749C4F41D4EA47
3 changed files with 8 additions and 8 deletions

View File

@ -2,17 +2,17 @@
name = "wasm-timer" name = "wasm-timer"
edition = "2018" edition = "2018"
description = "Abstraction over std::time::Instant and tokio_timer that works on WASM" description = "Abstraction over std::time::Instant and tokio_timer that works on WASM"
version = "0.1.2" version = "0.1.3"
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"] authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
license = "MIT" license = "MIT"
repository = "https://github.com/tomaka/wasm-timer" repository = "https://github.com/tomaka/wasm-timer"
[target.'cfg(any(target_arch = "wasm32"))'.dependencies] [target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
futures = "0.1" futures = "0.1"
js-sys = "0.3.14" js-sys = "0.3.14"
send_wrapper = "0.2" send_wrapper = "0.2"
wasm-bindgen = "0.2.37" wasm-bindgen = "0.2.37"
web-sys = { version = "0.3.14", features = ["Performance", "Window"] } web-sys = { version = "0.3.14", features = ["Performance", "Window"] }
[target.'cfg(not(any(target_arch = "wasm32")))'.dependencies] [target.'cfg(not(all(target_arch = "wasm32", target_os = "unknown")))'.dependencies]
tokio-timer = "0.2" tokio-timer = "0.2"

View File

@ -18,12 +18,12 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
pub use std::time::{Instant, SystemTime, UNIX_EPOCH}; pub use std::time::{Instant, SystemTime, UNIX_EPOCH};
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
pub use tokio_timer::*; pub use tokio_timer::*;
#[cfg(target_arch = "wasm32")] #[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
pub use wasm::*; pub use wasm::*;
#[cfg(target_arch = "wasm32")] #[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
mod wasm; mod wasm;

View File

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
#![cfg(target_arch = "wasm32")] #![cfg(all(target_arch = "wasm32", target_os = "unknown"))]
use futures::{prelude::*, sync::oneshot, try_ready}; use futures::{prelude::*, sync::oneshot, try_ready};
use std::{error, fmt}; use std::{error, fmt};