-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port dom, fetch, guide-supported-types-examples, import_js examples to Rust 2018 edition #1103
Port dom, fetch, guide-supported-types-examples, import_js examples to Rust 2018 edition #1103
Conversation
FWIW, it is probably best to file this upstream in cargo's issue tracker! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the little nitpicks below addressed :)
examples/dom/src/lib.rs
Outdated
extern crate wasm_bindgen; | ||
extern crate web_sys; | ||
|
||
use web_sys; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line shouldn't be necessary in 2018 edition either :)
@@ -1,6 +1,6 @@ | |||
#![allow(unused_variables, dead_code)] | |||
|
|||
extern crate wasm_bindgen; | |||
use wasm_bindgen; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here and elsewhere. In general, we don't need use some_crate;
in order to do some_crate::Something
.
@fitzgen |
examples/fetch/src/lib.rs
Outdated
extern crate js_sys; | ||
extern crate wasm_bindgen; | ||
extern crate wasm_bindgen_futures; | ||
extern crate web_sys; | ||
#[macro_use] | ||
extern crate serde_derive; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're extra ambitious, we can actually remove serde_derive
both here and in Cargo.toml
by adding this to Cargo.toml
:
[dependencies]
serde = { version = "1.0.80", features = ["derive"] }
and then adding here:
use serde::{Deserialize, Serialize};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcrichton
Thank you for your comment.
I'll try it !!
I added |
👍 Thanks! |
This PR ports the following examples:
I run these command.
Relates to #1099.
🐞 bug report
When I run
$ cargo fix --edition-idioms
inimport_js
, I got an error message.full output: