From b59c77c3e73d530c54c9c4b65841048cdad1b294 Mon Sep 17 00:00:00 2001 From: Lars Bergstrom Date: Fri, 4 Apr 2014 09:16:32 -0500 Subject: [PATCH] Rust upgrade --- dictionary.rs | 4 ++-- string.rs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dictionary.rs b/dictionary.rs index 79edfde..5063470 100644 --- a/dictionary.rs +++ b/dictionary.rs @@ -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 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 { diff --git a/string.rs b/string.rs index 7babf2a..3101c3c 100644 --- a/string.rs +++ b/string.rs @@ -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,