Skip to content

Commit

Permalink
Merge pull request rustwasm#1103 from T5uku5hi/port-examples-to-rust-…
Browse files Browse the repository at this point in the history
…2018

Port dom, fetch, guide-supported-types-examples, import_js examples to Rust 2018 edition
  • Loading branch information
alexcrichton authored Dec 11, 2018
2 parents c92b261 + b6db977 commit 82b322a
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 16 deletions.
1 change: 1 addition & 0 deletions examples/dom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "dom"
version = "0.1.0"
authors = ["The wasm-bindgen Developers"]
edition = "2018"

[lib]
crate-type = ["cdylib"]
Expand Down
3 changes: 0 additions & 3 deletions examples/dom/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate wasm_bindgen;
extern crate web_sys;

use wasm_bindgen::prelude::*;

// Called by our JS entry point to run the example
Expand Down
3 changes: 2 additions & 1 deletion examples/fetch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "fetch"
version = "0.1.0"
authors = ["The wasm-bindgen Developers"]
edition = "2018"

[lib]
crate-type = ["cdylib"]
Expand All @@ -11,7 +12,7 @@ futures = "0.1.20"
wasm-bindgen = { version = "0.2.29", features = ["serde-serialize"] }
js-sys = "0.3.6"
wasm-bindgen-futures = "0.3.6"
serde = "^1.0.59"
serde = { version = "1.0.80", features = ["derive"] }
serde_derive = "^1.0.59"

[dependencies.web-sys]
Expand Down
9 changes: 1 addition & 8 deletions examples/fetch/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
extern crate futures;
extern crate js_sys;
extern crate wasm_bindgen;
extern crate wasm_bindgen_futures;
extern crate web_sys;
#[macro_use]
extern crate serde_derive;

use futures::{future, Future};
use js_sys::Promise;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use wasm_bindgen_futures::future_to_promise;
use wasm_bindgen_futures::JsFuture;
use web_sys::{Request, RequestInit, RequestMode, Response};
use serde::{Deserialize, Serialize};

/// A struct to hold some data from the github Branch API.
///
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 @@ -2,6 +2,7 @@
name = "guide-supported-types-examples"
version = "0.1.0"
authors = ["The wasm-bindgen Developers"]
edition = "2018"

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 0 additions & 2 deletions examples/guide-supported-types-examples/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![allow(unused_variables, dead_code)]

extern crate wasm_bindgen;

pub mod bool;
pub mod boxed_js_value_slice;
pub mod boxed_number_slices;
Expand Down
1 change: 1 addition & 0 deletions examples/import_js/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "import_js"
version = "0.1.0"
authors = ["The wasm-bindgen Developers"]
edition = "2018"

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 0 additions & 2 deletions examples/import_js/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate wasm_bindgen;

use wasm_bindgen::prelude::*;

#[wasm_bindgen(module = "./defined-in-js")]
Expand Down

0 comments on commit 82b322a

Please sign in to comment.