From 1dd9a40a05af7c1f230ee0d84b56e93206d5d6da Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Thu, 12 Aug 2021 19:02:44 -0700 Subject: [PATCH] Simplify implementation signatures for blittable parameters (#1042) --- crates/gen/src/parser/method_signature.rs | 2 +- tests/implement/tests/com_chain.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/gen/src/parser/method_signature.rs b/crates/gen/src/parser/method_signature.rs index 43277ba91a..26528bb856 100644 --- a/crates/gen/src/parser/method_signature.rs +++ b/crates/gen/src/parser/method_signature.rs @@ -480,7 +480,7 @@ impl MethodParam { let kind = self.signature.kind.gen_name(gen); if self.param.is_input() { - if self.signature.kind.is_primitive() { + if self.signature.kind.is_blittable() { quote! { #name } } else { quote! { &*(&#name as *const <#kind as ::windows::Abi>::Abi as *const <#kind as ::windows::Abi>::DefaultType) } diff --git a/tests/implement/tests/com_chain.rs b/tests/implement/tests/com_chain.rs index be5703f59b..34a3f9bb10 100644 --- a/tests/implement/tests/com_chain.rs +++ b/tests/implement/tests/com_chain.rs @@ -21,8 +21,7 @@ impl Test { Ok(()) } - // TODO: should be able to declare BOOL without a reference. - fn Save(&self, _: &Option, _: &BOOL) -> Result<()> { + fn Save(&self, _: &Option, _: BOOL) -> Result<()> { Ok(()) }