Skip to content
This repository was archived by the owner on Oct 30, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ jobs:
export RUST_BACKTRACE=1
cargo test --all || exit
displayName: "Run cargo test"
- job: wasm
pool:
vmImage: 'ubuntu-16.04'
displayName: "build --target wasm32-unknown-unknown"
steps:
- template: ci/install-rust.yml
parameters:
rust_version: nightly
- bash: |
export RUST_BACKTRACE=1
rustup target add wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown
displayName: "Run cargo build --target wasm32-unknown-unknown"
- job: check_benches
pool:
vmImage: 'ubuntu-16.04'
Expand Down
8 changes: 4 additions & 4 deletions runtime-native/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
rust_2018_idioms
)]

#[cfg(all(feature = "wasm-bindgen", target_arch = "wasm32"))]
#[cfg(target_arch = "wasm32")]
mod wasm32;
#[cfg(all(feature = "wasm-bindgen", target_arch = "wasm32"))]
#[cfg(target_arch = "wasm32")]
pub use wasm32::Native;

#[cfg(not(all(feature = "wasm-bindgen", target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
mod not_wasm32;
#[cfg(not(all(feature = "wasm-bindgen", target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
pub use not_wasm32::Native;
4 changes: 0 additions & 4 deletions runtime-native/src/wasm32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ use std::net::SocketAddr;
use std::pin::Pin;
use std::time::{Duration, Instant};

use wasm_bindgen::prelude::*;
use wasm_bindgen_futures::future_to_promise;

/// The Native runtime.
#[derive(Debug)]
pub struct Native;

impl runtime_raw::Runtime for Native {
fn spawn_boxed(&self, fut: BoxFuture<'static, ()>) -> Result<(), SpawnError> {
use futures01::future::Future;
let fut = fut.unit_error().compat();
wasm_bindgen_futures::spawn_local(fut);
Ok(())
Expand Down