Fallout of std::str stabilization

This commit is contained in:
Alex Crichton 2014-12-10 19:46:38 -08:00
parent 4908017d59
commit 082bfde412
193 changed files with 2143 additions and 2230 deletions

View file

@ -32,7 +32,7 @@ use path::Path;
use result::Result::{Ok, Err};
use sync::{StaticMutex, MUTEX_INIT};
use slice::SliceExt;
use str::StrPrelude;
use str::StrExt;
use dynamic_lib::DynamicLibrary;
use sys_common::backtrace::*;

View file

@ -23,6 +23,7 @@ use io;
use prelude::*;
use sys;
use sys::os;
use sys_common::{keep_going, eof, mkerr_libc};
use io::{FilePermission, Write, UnstableFileStat, Open, FileAccess, FileMode};
@ -262,7 +263,7 @@ pub fn readdir(p: &Path) -> IoResult<Vec<Path>> {
let mut more_files = 1 as libc::BOOL;
while more_files != 0 {
{
let filename = str::truncate_utf16_at_nul(&wfd.cFileName);
let filename = os::truncate_utf16_at_nul(&wfd.cFileName);
match String::from_utf16(filename) {
Some(filename) => paths.push(Path::new(filename)),
None => {

View file

@ -168,7 +168,7 @@ pub fn getcwd() -> IoResult<Path> {
}
}
match String::from_utf16(::str::truncate_utf16_at_nul(&buf)) {
match String::from_utf16(truncate_utf16_at_nul(&buf)) {
Some(ref cwd) => Ok(Path::new(cwd)),
None => Err(IoError {
kind: OtherIoError,
@ -279,7 +279,7 @@ pub fn load_self() -> Option<Vec<u8>> {
unsafe {
fill_utf16_buf_and_decode(|buf, sz| {
libc::GetModuleFileNameW(0u as libc::DWORD, buf, sz)
}).map(|s| s.into_string().into_bytes())
}).map(|s| s.to_string().into_bytes())
}
}

View file

@ -122,7 +122,7 @@ impl Process {
use mem;
use iter::{Iterator, IteratorExt};
use str::StrPrelude;
use str::StrExt;
if cfg.gid().is_some() || cfg.uid().is_some() {
return Err(IoError {

View file

@ -111,7 +111,7 @@ impl TTY {
}
pub fn write(&mut self, buf: &[u8]) -> IoResult<()> {
let utf16 = match from_utf8(buf) {
let utf16 = match from_utf8(buf).ok() {
Some(utf8) => {
utf8.utf16_units().collect::<Vec<u16>>()
}