Merge pull request #29 from larsbergstrom/rustup_20140321

Rust upgrade
This commit is contained in:
Jack Moffitt
2014-04-04 08:18:55 -06:00
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ use base::{CFTypeRef, TCFType, kCFAllocatorDefault};
use std::cast;
use std::libc::c_void;
use std::ptr;
use std::vec;
use std::slice;
pub type CFDictionaryApplierFunction = *u8;
pub type CFDictionaryCopyDescriptionCallBack = *u8;
@@ -82,7 +82,7 @@ impl TCFType<CFDictionaryRef> for CFDictionary {
impl CFDictionary {
pub fn from_CFType_pairs(pairs: &[(CFType, CFType)]) -> CFDictionary {
let (keys, values) =
vec::unzip(pairs.iter()
slice::unzip(pairs.iter()
.map(|&(ref key, ref value)| (key.as_CFTypeRef(),
value.as_CFTypeRef())));
unsafe {
+3 -2
View File
@@ -16,9 +16,10 @@ use base::{CFRelease, CFTypeID, TCFType, kCFAllocatorDefault, kCFAllocatorNull};
use std::cast;
use std::fmt;
use std::from_str::FromStr;
use std::libc;
use std::ptr;
use std::vec;
use std::slice;
pub type UniChar = libc::c_ushort;
@@ -278,7 +279,7 @@ impl fmt::Show for CFString {
&mut bytes_required);
// Then, allocate the buffer and actually copy.
let buffer: ~[u8] = vec::from_elem(bytes_required as uint, '\x00' as u8);
let buffer: ~[u8] = slice::from_elem(bytes_required as uint, '\x00' as u8);
let mut bytes_used: CFIndex = 0;
let chars_written = CFStringGetBytes(self.obj,
range,