mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 12:31:22 +00:00
Migrate all crates to the 2018 edition
Most of the CLI crates were already in the 2018 edition, and it turns out that one of the macro crates was already in the 2018 edition so we may as well move everything to the 2018 edition! Always nice to remove those `extern crate` statements nowadays! This commit also does a `cargo fmt --all` to make sure we're conforming with style again.
This commit is contained in:
@ -5,6 +5,7 @@ authors = ["The wasm-bindgen Developers"]
|
||||
description = "Internal testing macro for wasm-bindgen"
|
||||
license = "MIT/Apache-2.0"
|
||||
repository = "https://github.com/rustwasm/wasm-bindgen"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
proc-macro2 = "0.4"
|
||||
|
@ -2,11 +2,9 @@
|
||||
//! going on here.
|
||||
|
||||
extern crate proc_macro;
|
||||
extern crate proc_macro2;
|
||||
#[macro_use]
|
||||
extern crate quote;
|
||||
|
||||
use proc_macro2::*;
|
||||
use quote::quote;
|
||||
use std::sync::atomic::*;
|
||||
|
||||
static CNT: AtomicUsize = AtomicUsize::new(0);
|
||||
@ -17,10 +15,10 @@ pub fn wasm_bindgen_test(
|
||||
body: proc_macro::TokenStream,
|
||||
) -> proc_macro::TokenStream {
|
||||
let mut attr = attr.into_iter();
|
||||
let mut async = false;
|
||||
let mut r#async = false;
|
||||
while let Some(token) = attr.next() {
|
||||
match &token {
|
||||
proc_macro::TokenTree::Ident(i) if i.to_string() == "async" => async = true,
|
||||
proc_macro::TokenTree::Ident(i) if i.to_string() == "async" => r#async = true,
|
||||
_ => panic!("malformed `#[wasm_bindgen_test]` attribute"),
|
||||
}
|
||||
match &attr.next() {
|
||||
@ -49,7 +47,7 @@ pub fn wasm_bindgen_test(
|
||||
|
||||
let mut tokens = Vec::<TokenTree>::new();
|
||||
|
||||
let test_body = if async {
|
||||
let test_body = if r#async {
|
||||
quote! { cx.execute_async(test_name, #ident); }
|
||||
} else {
|
||||
quote! { cx.execute_sync(test_name, #ident); }
|
||||
|
Reference in New Issue
Block a user