mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-05-19 00:51:19 +00:00
Use anyref
helper to reduce some code duplication
This commit is contained in:
parent
a85e49a2b4
commit
a2d6a8ff53
@ -517,11 +517,7 @@ impl<'a> IdlType<'a> {
|
|||||||
| IdlType::Dictionary(name)
|
| IdlType::Dictionary(name)
|
||||||
| IdlType::CallbackInterface { name, .. } => {
|
| IdlType::CallbackInterface { name, .. } => {
|
||||||
let ty = ident_ty(rust_ident(camel_case_ident(name).as_str()));
|
let ty = ident_ty(rust_ident(camel_case_ident(name).as_str()));
|
||||||
if pos == TypePosition::Argument {
|
anyref(ty)
|
||||||
Some(shared_ref(ty, false))
|
|
||||||
} else {
|
|
||||||
Some(ty)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
IdlType::Enum(name) => Some(ident_ty(rust_ident(camel_case_ident(name).as_str()))),
|
IdlType::Enum(name) => Some(ident_ty(rust_ident(camel_case_ident(name).as_str()))),
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user