mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-07-21 23:21:58 +00:00
cargo +nightly fmt --all
Rustfmt all the things!
This commit is contained in:
crates
backend
cli-support
cli
src
bin
futures
src
js-sys
tests
headless.rs
wasm
Array.rsArrayBuffer.rsArrayIterator.rsBoolean.rsDate.rsError.rsEvalError.rsFunction.rsGenerator.rsIntl.rsIterator.rsJSON.rsJsString.rsMap.rsMapIterator.rsMath.rsNumber.rsPromise.rsProxy.rsRangeError.rsReferenceError.rsReflect.rsRegExp.rsSet.rsSetIterator.rsSymbol.rsSyntaxError.rsTypeError.rsTypedArray.rsUriError.rsWeakMap.rsWeakSet.rsWebAssembly.rsglobal_fns.rsmain.rs
macro-support
test-macro
src
test
typescript
src
wasm-interpreter
web-sys
build.rs
src
tests
wasm
anchor_element.rsbody_element.rsbr_element.rsbutton_element.rsdiv_element.rselement.rsevent.rshead_element.rsheaders.rsheading_element.rshistory.rshr_element.rshtml_element.rshtml_html_element.rsinput_element.rsmain.rsmeta_element.rsmeter_element.rsmod_elements.rsolist_element.rsoptgroup_element.rsoption_element.rsoptions_collection.rsoutput_element.rsparagraph_element.rsparam_element.rsperformance.rspre_element.rsprogress_element.rsquote_element.rsresponse.rsscript_element.rsselect_element.rsslot_element.rsspan_element.rsstyle_element.rstable_element.rstitle_element.rsxpath_result.rs
webidl-tests
webidl
examples
canvas
src
closures
src
duck-typed-interfaces
src
fetch
src
guide-supported-types-examples
julia_set
src
performance
src
src
tests
@@ -6,8 +6,8 @@ extern crate proc_macro2;
|
||||
#[macro_use]
|
||||
extern crate quote;
|
||||
|
||||
use std::sync::atomic::*;
|
||||
use proc_macro2::*;
|
||||
use std::sync::atomic::*;
|
||||
|
||||
static CNT: AtomicUsize = ATOMIC_USIZE_INIT;
|
||||
|
||||
@@ -38,7 +38,7 @@ pub fn wasm_bindgen_test(
|
||||
leading_tokens.push(token.clone());
|
||||
if let TokenTree::Ident(token) = token {
|
||||
if token == "fn" {
|
||||
break
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,18 +58,24 @@ pub fn wasm_bindgen_test(
|
||||
// We generate a `#[no_mangle]` with a known prefix so the test harness can
|
||||
// later slurp up all of these functions and pass them as arguments to the
|
||||
// main test harness. This is the entry point for all tests.
|
||||
let name = format!("__wbg_test_{}_{}", ident, CNT.fetch_add(1, Ordering::SeqCst));
|
||||
let name = format!(
|
||||
"__wbg_test_{}_{}",
|
||||
ident,
|
||||
CNT.fetch_add(1, Ordering::SeqCst)
|
||||
);
|
||||
let name = Ident::new(&name, Span::call_site());
|
||||
tokens.extend((quote! {
|
||||
#[no_mangle]
|
||||
pub extern fn #name(cx: *const ::wasm_bindgen_test::__rt::Context) {
|
||||
unsafe {
|
||||
let cx = &*cx;
|
||||
let test_name = concat!(module_path!(), "::", stringify!(#ident));
|
||||
#test_body
|
||||
tokens.extend(
|
||||
(quote! {
|
||||
#[no_mangle]
|
||||
pub extern fn #name(cx: *const ::wasm_bindgen_test::__rt::Context) {
|
||||
unsafe {
|
||||
let cx = &*cx;
|
||||
let test_name = concat!(module_path!(), "::", stringify!(#ident));
|
||||
#test_body
|
||||
}
|
||||
}
|
||||
}
|
||||
}).into_iter());
|
||||
}).into_iter(),
|
||||
);
|
||||
|
||||
tokens.extend(leading_tokens);
|
||||
tokens.push(ident.into());
|
||||
|
Reference in New Issue
Block a user