Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernization and cleanup #69

Merged
merged 8 commits into from Sep 5, 2015
Merged

Clean up dictionary

* Abstract from_CFType_pairs over TCFTypes
  • Loading branch information
sfackler committed Aug 29, 2015
commit 64d3c5f63e3cfc9fff842e04216f4351f89e3f15
@@ -100,7 +100,8 @@ impl TCFType<CFDictionaryRef> for CFDictionary {
}

impl CFDictionary {
pub fn from_CFType_pairs(pairs: &[(CFType, CFType)]) -> CFDictionary {
pub fn from_CFType_pairs<R1, R2, K, V>(pairs: &[(K, V)]) -> CFDictionary
where K: TCFType<R1>, V: TCFType<R2> {
let (keys, values): (Vec<CFTypeRef>,Vec<CFTypeRef>) =
pairs.iter()
.map(|&(ref key, ref value)| (key.as_CFTypeRef(), value.as_CFTypeRef()))
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.