Skip to content

Commit

Permalink
Fix non-compliling examples (#2624)
Browse files Browse the repository at this point in the history
* Fix non-compliling examples

* Add CI job to run cargo check (to ensure examples don't break in the future)
  • Loading branch information
Jules-Bertholet authored Jul 19, 2021
1 parent 872c57e commit 7caeb31
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ jobs:
- template: ci/azure-install-rust.yml
- script: cargo fmt --all -- --check

- job: cargo_check
displayName: "Run cargo check"
steps:
- template: ci/azure-install-rust.yml
- script: cargo check --all

- job: test_wasm_bindgen
displayName: "Run wasm-bindgen crate tests (unix)"
steps:
Expand Down
1 change: 1 addition & 0 deletions examples/guide-supported-types-examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = "0.2.74"
js-sys = "0.3.51"
2 changes: 2 additions & 0 deletions examples/guide-supported-types-examples/src/imported_types.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
use wasm_bindgen::prelude::*;

#[wasm_bindgen]
#[derive(Copy, Clone, Debug)]
pub enum NumberEnum {
Foo = 0,
Bar = 1,
Qux = 2,
}

#[wasm_bindgen]
#[derive(Copy, Clone, Debug)]
pub enum StringEnum {
Foo = "foo",
Bar = "bar",
Expand Down
2 changes: 2 additions & 0 deletions examples/webxr/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg(web_sys_unstable_apis)]

#[macro_use]
mod utils;

Expand Down

0 comments on commit 7caeb31

Please sign in to comment.