Skip to content

Commit 74bec76

Browse files
committed
Return String instead of Result<String, JsValue>
1 parent fc615e6 commit 74bec76

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

crates/backend/src/codegen.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,7 @@ impl TryToTokens for ast::LinkToModule {
144144
#extern_fn
145145

146146
unsafe {
147-
let _ret = #name();
148-
wasm_bindgen::__rt::take_last_exception().map(|()| {
149-
<String as wasm_bindgen::convert::FromWasmAbi>::from_abi(_ret)
150-
})
147+
<String as wasm_bindgen::convert::FromWasmAbi>::from_abi(#name())
151148
}
152149
}
153150
})

crates/futures/src/task/wait_async_polyfill.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn alloc_helper() -> Worker {
5353
return helper;
5454
}
5555

56-
let worker_url = wasm_bindgen::link_to!(module = "/src/task/worker.js").unwrap();
56+
let worker_url = wasm_bindgen::link_to!(module = "/src/task/worker.js");
5757
Worker::new(&worker_url).unwrap_or_else(|js| wasm_bindgen::throw_val(js))
5858
})
5959
}

crates/macro/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn link_to(input: TokenStream) -> TokenStream {
2727
}
2828
tokens.into()
2929
}
30-
Err(diagnostic) => (quote! { Result::<String, JsValue>::Ok(#diagnostic) }).into(),
30+
Err(diagnostic) => (quote! { String::clone(#diagnostic) }).into(),
3131
}
3232
}
3333

0 commit comments

Comments
 (0)