@@ -68,7 +68,7 @@ pub struct CFWrapper<T, PlaceholderType1, PlaceholderType2> {
|
||||
|
||||
#[unsafe_destructor]
|
||||
impl<T,E1,E2> Drop for CFWrapper<T,E1,E2> {
|
||||
fn finalize(&self) {
|
||||
fn drop(&self) {
|
||||
unsafe {
|
||||
// sadly, cannot use obj.as_type_ref() here, because drop
|
||||
// cannot make virtual method calls using trait
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ impl<KeyRefType: Copy + AbstractCFTypeRef, ValueRefType: Copy + AbstractCFTypeRe
|
||||
pub fn new(pairs: &[(KeyRefType,ValueRefType)]) -> CFDictionary<KeyRefType, ValueRefType> {
|
||||
let mut keys : ~[CFTypeRef] = ~[];
|
||||
let mut values : ~[CFTypeRef] = ~[];
|
||||
for pairs.each |pair| {
|
||||
for pairs.iter().advance |pair| {
|
||||
// FIXME: "let" would be much nicer here, but that doesn't work yet.
|
||||
match *pair {
|
||||
(ref key, ref value) => {
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(non_uppercase_statics)];
|
||||
|
||||
use base::{AbstractCFTypeRef, Boolean, CFAllocatorRef, CFTypeID, CFTypeRef, CFWrapper};
|
||||
use base::{kCFAllocatorDefault};
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ pub struct CFSet<ElemRefType> {
|
||||
impl<ElemRefType : AbstractCFTypeRef> CFSet<ElemRefType> {
|
||||
pub fn new(elems: &[ElemRefType]) -> CFSet<ElemRefType> {
|
||||
let result: CFSetRef;
|
||||
let elems_refs = do vec::map(elems) |e: &ElemRefType| {
|
||||
let elems_refs = do elems.map |e: &ElemRefType| {
|
||||
e.as_type_ref()
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(non_uppercase_statics)];
|
||||
|
||||
use base::{AbstractCFTypeRef, Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFRange};
|
||||
use base::{CFRangeMake, CFTypeRef, CFTypeID, CFWrapper, kCFAllocatorDefault, kCFAllocatorNull};
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[allow(non_uppercase_statics)];
|
||||
|
||||
use base::{AbstractCFTypeRef, CFAllocatorRef, CFOptionFlags, CFTypeID, CFTypeRef, CFWrapper};
|
||||
use data::{CFDataRef};
|
||||
use string::{CFString, CFStringRef, CFStringEncoding};
|
||||
|
||||
Reference in New Issue
Block a user