From 60338d91c4334e5fdfbd37b298cd5b99e8fc0cdd Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 27 Nov 2014 14:43:55 -0500 Subject: libstd: remove unnecessary `as_slice()` calls --- src/libstd/sys/windows/fs.rs | 4 ++-- src/libstd/sys/windows/process.rs | 4 ++-- src/libstd/sys/windows/tty.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libstd/sys') diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs index 9402c63dcf5..16779a80185 100644 --- a/src/libstd/sys/windows/fs.rs +++ b/src/libstd/sys/windows/fs.rs @@ -376,8 +376,8 @@ pub fn readlink(p: &Path) -> IoResult { libc::VOLUME_NAME_DOS) }); let ret = match ret { - Some(ref s) if s.as_slice().starts_with(r"\\?\") => { // " - Ok(Path::new(s.as_slice().slice_from(4))) + Some(ref s) if s.starts_with(r"\\?\") => { // " + Ok(Path::new(s.slice_from(4))) } Some(s) => Ok(Path::new(s)), None => Err(super::last_error()), diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index 78a8e09dac1..2af5e4890e8 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -223,7 +223,7 @@ impl Process { with_envp(cfg.env(), |envp| { with_dirp(cfg.cwd(), |dirp| { - let mut cmd_str: Vec = cmd_str.as_slice().utf16_units().collect(); + let mut cmd_str: Vec = cmd_str.utf16_units().collect(); cmd_str.push(0); let created = CreateProcessW(ptr::null(), cmd_str.as_mut_ptr(), @@ -433,7 +433,7 @@ fn with_envp(env: Option<&collections::HashMap>, let kv = format!("{}={}", pair.ref0().container_as_str().unwrap(), pair.ref1().container_as_str().unwrap()); - blk.extend(kv.as_slice().utf16_units()); + blk.extend(kv.utf16_units()); blk.push(0); } diff --git a/src/libstd/sys/windows/tty.rs b/src/libstd/sys/windows/tty.rs index 0e7b06cbb94..51679bb2003 100644 --- a/src/libstd/sys/windows/tty.rs +++ b/src/libstd/sys/windows/tty.rs @@ -113,7 +113,7 @@ impl TTY { pub fn write(&mut self, buf: &[u8]) -> IoResult<()> { let utf16 = match from_utf8(buf) { Some(utf8) => { - utf8.as_slice().utf16_units().collect::>() + utf8.utf16_units().collect::>() } None => return Err(invalid_encoding()), }; -- cgit 1.4.1-3-g733a5