Skip to content

Commit 2e05b62

Browse files
authored
Merge pull request #1583 from Pauan/asref
Adding in AsRef impl for all wasm_bindgen types
2 parents 96d333a + b205045 commit 2e05b62

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/backend/src/codegen.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,11 @@ impl ToTokens for ast::ImportType {
703703
fn as_ref(&self) -> &JsValue { self.obj.as_ref() }
704704
}
705705

706+
impl AsRef<#rust_name> for #rust_name {
707+
#[inline]
708+
fn as_ref(&self) -> &#rust_name { self }
709+
}
710+
706711

707712
impl From<#rust_name> for JsValue {
708713
#[inline]

0 commit comments

Comments
 (0)