From 3ac862816fc57fb6047986624d98f986cbfd40b9 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Wed, 4 Feb 2015 01:00:38 +0200 Subject: Replace usage of slice::from_raw_buf with slice::from_raw_parts New functions, slice::from_raw_parts and slice::from_raw_parts_mut, are added to implement the lifetime convention as agreed in RFC PR #556. The functions slice::from_raw_buf and slice::from_raw_mut_buf are left deprecated for the time being. --- src/libstd/sys/windows/os.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstd/sys') diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs index c71e2d057c3..d8e3e6981df 100644 --- a/src/libstd/sys/windows/os.rs +++ b/src/libstd/sys/windows/os.rs @@ -109,7 +109,7 @@ impl Iterator for Env { len += 1; } let p = p as *const u16; - let s = slice::from_raw_buf(&p, len as usize); + let s = slice::from_raw_parts(p, len as usize); self.cur = self.cur.offset(len + 1); let (k, v) = match s.iter().position(|&b| b == '=' as u16) { @@ -296,7 +296,7 @@ impl Iterator for Args { // Push it onto the list. let ptr = ptr as *const u16; - let buf = slice::from_raw_buf(&ptr, len as usize); + let buf = slice::from_raw_parts(ptr, len as usize); OsStringExt::from_wide(buf) }) } -- cgit 1.4.1-3-g733a5