From a2d6a8ff539e44e6d38f581450e8a2f4b12a339f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 20 Sep 2018 17:26:49 -0700 Subject: [PATCH] Use `anyref` helper to reduce some code duplication --- crates/webidl/src/idl_type.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/webidl/src/idl_type.rs b/crates/webidl/src/idl_type.rs index d5b4594e..7cfedc66 100644 --- a/crates/webidl/src/idl_type.rs +++ b/crates/webidl/src/idl_type.rs @@ -517,11 +517,7 @@ impl<'a> IdlType<'a> { | IdlType::Dictionary(name) | IdlType::CallbackInterface { name, .. } => { let ty = ident_ty(rust_ident(camel_case_ident(name).as_str())); - if pos == TypePosition::Argument { - Some(shared_ref(ty, false)) - } else { - Some(ty) - } + anyref(ty) }, IdlType::Enum(name) => Some(ident_ty(rust_ident(camel_case_ident(name).as_str()))),