From 493130ee36a0b83aa0b836fa41bf8de9309f7487 Mon Sep 17 00:00:00 2001 From: T5uku5hi Date: Wed, 12 Dec 2018 00:39:22 +0900 Subject: [PATCH 1/9] [examples] dom - port to rust 2018 --- examples/dom/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/dom/Cargo.toml b/examples/dom/Cargo.toml index 2f1ce44f800..58827226265 100644 --- a/examples/dom/Cargo.toml +++ b/examples/dom/Cargo.toml @@ -2,6 +2,7 @@ name = "dom" version = "0.1.0" authors = ["The wasm-bindgen Developers"] +edition = "2018" [lib] crate-type = ["cdylib"] From b2afc0e38adacd7bd068cddd426e4c67c6264556 Mon Sep 17 00:00:00 2001 From: T5uku5hi Date: Wed, 12 Dec 2018 00:40:00 +0900 Subject: [PATCH 2/9] run cargo fix --edition-idioms --- examples/dom/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/dom/src/lib.rs b/examples/dom/src/lib.rs index fc6a9628ee0..8a0386d37e3 100644 --- a/examples/dom/src/lib.rs +++ b/examples/dom/src/lib.rs @@ -1,5 +1,5 @@ -extern crate wasm_bindgen; -extern crate web_sys; + +use web_sys; use wasm_bindgen::prelude::*; From f148164cd38bb7e03d9cf8242e1a3a59aa9f2064 Mon Sep 17 00:00:00 2001 From: T5uku5hi Date: Wed, 12 Dec 2018 00:47:22 +0900 Subject: [PATCH 3/9] [examples] fetch - port to rust 2018 --- examples/fetch/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/fetch/Cargo.toml b/examples/fetch/Cargo.toml index 380cceeafcd..d90ec1ac3fe 100644 --- a/examples/fetch/Cargo.toml +++ b/examples/fetch/Cargo.toml @@ -2,6 +2,7 @@ name = "fetch" version = "0.1.0" authors = ["The wasm-bindgen Developers"] +edition = "2018" [lib] crate-type = ["cdylib"] From 2d9dcf6ace31544a7908b8b4abf71b7fa6aa994f Mon Sep 17 00:00:00 2001 From: T5uku5hi Date: Wed, 12 Dec 2018 00:48:10 +0900 Subject: [PATCH 4/9] run cargo fix --edition-idioms --- examples/fetch/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/fetch/src/lib.rs b/examples/fetch/src/lib.rs index 30588954c56..6f960c82586 100644 --- a/examples/fetch/src/lib.rs +++ b/examples/fetch/src/lib.rs @@ -1,8 +1,8 @@ -extern crate futures; -extern crate js_sys; -extern crate wasm_bindgen; -extern crate wasm_bindgen_futures; -extern crate web_sys; + + + + +use web_sys; #[macro_use] extern crate serde_derive; From 48cc61147bccd239c764b5f66c2ceea8f035db22 Mon Sep 17 00:00:00 2001 From: T5uku5hi Date: Wed, 12 Dec 2018 00:50:41 +0900 Subject: [PATCH 5/9] [examples] guide-supported-types-examples - port to rust 2018 --- examples/guide-supported-types-examples/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/guide-supported-types-examples/Cargo.toml b/examples/guide-supported-types-examples/Cargo.toml index a98c80f42a7..3e1d046a60b 100644 --- a/examples/guide-supported-types-examples/Cargo.toml +++ b/examples/guide-supported-types-examples/Cargo.toml @@ -2,6 +2,7 @@ name = "guide-supported-types-examples" version = "0.1.0" authors = ["The wasm-bindgen Developers"] +edition = "2018" [lib] crate-type = ["cdylib"] From 56b3e0a318e919452643f40d1a5c8f875dd03d15 Mon Sep 17 00:00:00 2001 From: T5uku5hi Date: Wed, 12 Dec 2018 00:51:23 +0900 Subject: [PATCH 6/9] run cargo fix --edition-idioms --- examples/guide-supported-types-examples/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/guide-supported-types-examples/src/lib.rs b/examples/guide-supported-types-examples/src/lib.rs index cd79099eb08..d1815506f31 100644 --- a/examples/guide-supported-types-examples/src/lib.rs +++ b/examples/guide-supported-types-examples/src/lib.rs @@ -1,6 +1,6 @@ #![allow(unused_variables, dead_code)] -extern crate wasm_bindgen; +use wasm_bindgen; pub mod bool; pub mod boxed_js_value_slice; From 7cf2942e25d5f75fcbc2c06c472f02611f68ff6e Mon Sep 17 00:00:00 2001 From: T5uku5hi Date: Wed, 12 Dec 2018 00:53:11 +0900 Subject: [PATCH 7/9] [examples] import_js - port to rust 2018 --- examples/import_js/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/import_js/Cargo.toml b/examples/import_js/Cargo.toml index 298f50f7324..a706a989299 100644 --- a/examples/import_js/Cargo.toml +++ b/examples/import_js/Cargo.toml @@ -2,6 +2,7 @@ name = "import_js" version = "0.1.0" authors = ["The wasm-bindgen Developers"] +edition = "2018" [lib] crate-type = ["cdylib"] From 0003fc9115ab79792aaffdf16f5f18ab9a86353f Mon Sep 17 00:00:00 2001 From: T5uku5hi Date: Wed, 12 Dec 2018 06:56:09 +0900 Subject: [PATCH 8/9] remove unnecessary lines --- examples/dom/src/lib.rs | 2 -- examples/fetch/src/lib.rs | 5 ----- examples/guide-supported-types-examples/src/lib.rs | 2 -- 3 files changed, 9 deletions(-) diff --git a/examples/dom/src/lib.rs b/examples/dom/src/lib.rs index 8a0386d37e3..1c0344b5247 100644 --- a/examples/dom/src/lib.rs +++ b/examples/dom/src/lib.rs @@ -1,6 +1,4 @@ -use web_sys; - use wasm_bindgen::prelude::*; // Called by our JS entry point to run the example diff --git a/examples/fetch/src/lib.rs b/examples/fetch/src/lib.rs index 6f960c82586..cb1e2c55ff5 100644 --- a/examples/fetch/src/lib.rs +++ b/examples/fetch/src/lib.rs @@ -1,8 +1,3 @@ - - - - -use web_sys; #[macro_use] extern crate serde_derive; diff --git a/examples/guide-supported-types-examples/src/lib.rs b/examples/guide-supported-types-examples/src/lib.rs index d1815506f31..2f209b440f5 100644 --- a/examples/guide-supported-types-examples/src/lib.rs +++ b/examples/guide-supported-types-examples/src/lib.rs @@ -1,7 +1,5 @@ #![allow(unused_variables, dead_code)] -use wasm_bindgen; - pub mod bool; pub mod boxed_js_value_slice; pub mod boxed_number_slices; From b6db977795d20f7b4861ac5377cf680bfb0ff138 Mon Sep 17 00:00:00 2001 From: T5uku5hi Date: Wed, 12 Dec 2018 07:14:26 +0900 Subject: [PATCH 9/9] removed extern crate lines --- examples/dom/src/lib.rs | 1 - examples/fetch/Cargo.toml | 2 +- examples/fetch/src/lib.rs | 4 +--- examples/import_js/src/lib.rs | 2 -- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/examples/dom/src/lib.rs b/examples/dom/src/lib.rs index 1c0344b5247..2e04b4b232f 100644 --- a/examples/dom/src/lib.rs +++ b/examples/dom/src/lib.rs @@ -1,4 +1,3 @@ - use wasm_bindgen::prelude::*; // Called by our JS entry point to run the example diff --git a/examples/fetch/Cargo.toml b/examples/fetch/Cargo.toml index d90ec1ac3fe..fd2b87cb32e 100644 --- a/examples/fetch/Cargo.toml +++ b/examples/fetch/Cargo.toml @@ -12,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] diff --git a/examples/fetch/src/lib.rs b/examples/fetch/src/lib.rs index cb1e2c55ff5..9ee7340e3bc 100644 --- a/examples/fetch/src/lib.rs +++ b/examples/fetch/src/lib.rs @@ -1,6 +1,3 @@ -#[macro_use] -extern crate serde_derive; - use futures::{future, Future}; use js_sys::Promise; use wasm_bindgen::prelude::*; @@ -8,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. /// diff --git a/examples/import_js/src/lib.rs b/examples/import_js/src/lib.rs index 9033e8089b3..a010ca93ce1 100644 --- a/examples/import_js/src/lib.rs +++ b/examples/import_js/src/lib.rs @@ -1,5 +1,3 @@ -extern crate wasm_bindgen; - use wasm_bindgen::prelude::*; #[wasm_bindgen(module = "./defined-in-js")]