mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2025-01-05 19:53:55 +03:00
Merge pull request #1103 from T5uku5hi/port-examples-to-rust-2018
Port dom, fetch, guide-supported-types-examples, import_js examples to Rust 2018 edition
This commit is contained in:
commit
82b322a12f
@ -2,6 +2,7 @@
|
||||
name = "dom"
|
||||
version = "0.1.0"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
edition = "2018"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
@ -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
|
||||
|
@ -2,6 +2,7 @@
|
||||
name = "fetch"
|
||||
version = "0.1.0"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
edition = "2018"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
@ -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]
|
||||
|
@ -1,11 +1,3 @@
|
||||
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::*;
|
||||
@ -13,6 +5,7 @@ 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.
|
||||
///
|
||||
|
@ -2,6 +2,7 @@
|
||||
name = "guide-supported-types-examples"
|
||||
version = "0.1.0"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
edition = "2018"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
@ -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;
|
||||
|
@ -2,6 +2,7 @@
|
||||
name = "import_js"
|
||||
version = "0.1.0"
|
||||
authors = ["The wasm-bindgen Developers"]
|
||||
edition = "2018"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
@ -1,5 +1,3 @@
|
||||
extern crate wasm_bindgen;
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen(module = "./defined-in-js")]
|
||||
|
Loading…
Reference in New Issue
Block a user