diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-12-18 02:37:30 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-12-19 10:18:02 +1100 |
| commit | 17ac2aa523f03c386669f569bc89019deb0c0ecd (patch) | |
| tree | 52fe2a7bdedb308a25f4515cca59407a66d67ee7 /src/libstd/os.rs | |
| parent | 9177f7ecb4d897a72aeaa0b3dfed930286946cf3 (diff) | |
| download | rust-17ac2aa523f03c386669f569bc89019deb0c0ecd.tar.gz rust-17ac2aa523f03c386669f569bc89019deb0c0ecd.zip | |
std::str: replace .as_imm_buf with .as_ptr.
Diffstat (limited to 'src/libstd/os.rs')
| -rw-r--r-- | src/libstd/os.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libstd/os.rs b/src/libstd/os.rs index d55d7ec8a1a..8da7c0340f7 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -72,13 +72,11 @@ pub fn getcwd() -> Path { use libc::DWORD; use libc::GetCurrentDirectoryW; let mut buf = [0 as u16, ..BUF_BYTES]; - buf.as_mut_buf(|buf, len| { - unsafe { - if libc::GetCurrentDirectoryW(len as DWORD, buf) == 0 as DWORD { - fail!(); - } + unsafe { + if libc::GetCurrentDirectoryW(buf.len() as DWORD, buf.as_mut_ptr()) == 0 as DWORD { + fail!(); } - }); + } Path::new(str::from_utf16(buf)) } |
