From 8ca27465894c2a46cb5f553c41b00b2ff2feaff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Tue, 23 Oct 2018 09:38:35 +0200 Subject: [PATCH] Implement ConcreteCFType for CFDictionary<*void, *void> --- core-foundation/src/dictionary.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core-foundation/src/dictionary.rs b/core-foundation/src/dictionary.rs index ca0e277..5b3faf5 100644 --- a/core-foundation/src/dictionary.rs +++ b/core-foundation/src/dictionary.rs @@ -19,6 +19,7 @@ use std::marker::PhantomData; use base::{ItemRef, FromVoid, ToVoid}; use base::{CFIndexConvertible, TCFType}; +use ConcreteCFType; // consume the type parameters with PhantomDatas pub struct CFDictionary(CFDictionaryRef, PhantomData, PhantomData); @@ -32,6 +33,8 @@ impl Drop for CFDictionary { impl_TCFType!(CFDictionary, CFDictionaryRef, CFDictionaryGetTypeID); impl_CFTypeDescription!(CFDictionary); +unsafe impl ConcreteCFType for CFDictionary<*const c_void, *const c_void> {} + impl CFDictionary { pub fn from_CFType_pairs(pairs: &[(K, V)]) -> CFDictionary where K: TCFType, V: TCFType { let (keys, values): (Vec, Vec) = pairs