Skip to content

Commit

Permalink
Merge pull request #1583 from Pauan/asref
Browse files Browse the repository at this point in the history
Adding in AsRef impl for all wasm_bindgen types
  • Loading branch information
alexcrichton authored Jun 10, 2019
2 parents 96d333a + b205045 commit 2e05b62
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/backend/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,11 @@ impl ToTokens for ast::ImportType {
fn as_ref(&self) -> &JsValue { self.obj.as_ref() }
}

impl AsRef<#rust_name> for #rust_name {
#[inline]
fn as_ref(&self) -> &#rust_name { self }
}


impl From<#rust_name> for JsValue {
#[inline]
Expand Down

0 comments on commit 2e05b62

Please sign in to comment.