From de39874801761197bf10bf8d04bde1aa2bd82e15 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Thu, 5 Sep 2013 14:17:24 +0200 Subject: Rename str::from_bytes to str::from_utf8, closes #8985 --- src/libstd/rt/uv/file.rs | 4 ++-- src/libstd/rt/uv/net.rs | 2 +- src/libstd/rt/uv/uvio.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libstd/rt/uv') diff --git a/src/libstd/rt/uv/file.rs b/src/libstd/rt/uv/file.rs index eaf70242440..15fe9abaa2c 100644 --- a/src/libstd/rt/uv/file.rs +++ b/src/libstd/rt/uv/file.rs @@ -329,7 +329,7 @@ mod test { if nread > 0 { let read_str = unsafe { let read_buf = *read_buf_ptr; - str::from_bytes( + str::from_utf8( vec::from_buf( read_buf.base, nread)) }; @@ -393,7 +393,7 @@ mod test { // nread == 0 would be EOF.. we know it's >= zero because otherwise // the above assert would fail if nread > 0 { - let read_str = str::from_bytes( + let read_str = str::from_utf8( read_mem.slice(0, nread as uint)); assert!(read_str == ~"hello"); // close diff --git a/src/libstd/rt/uv/net.rs b/src/libstd/rt/uv/net.rs index 3ff6e90e32d..6e890850654 100644 --- a/src/libstd/rt/uv/net.rs +++ b/src/libstd/rt/uv/net.rs @@ -83,7 +83,7 @@ fn uv_socket_addr_as_socket_addr(addr: UvSocketAddr, f: &fn(SocketAddr) -> T) }; port as u16 }; - let ip_str = str::from_bytes_slice(ip_name).trim_right_chars(&'\x00'); + let ip_str = str::from_utf8_slice(ip_name).trim_right_chars(&'\x00'); let ip_addr = FromStr::from_str(ip_str).unwrap(); // finally run the closure diff --git a/src/libstd/rt/uv/uvio.rs b/src/libstd/rt/uv/uvio.rs index e37dfba0cc1..6f9e3c43b0e 100644 --- a/src/libstd/rt/uv/uvio.rs +++ b/src/libstd/rt/uv/uvio.rs @@ -1812,7 +1812,7 @@ fn file_test_uvio_full_simple_impl() { let mut fd = (*io).fs_open(&Path(path), ro_fm, ro_fa).unwrap(); let mut read_vec = [0, .. 1028]; let nread = fd.read(read_vec).unwrap(); - let read_val = str::from_bytes(read_vec.slice(0, nread as uint)); + let read_val = str::from_utf8(read_vec.slice(0, nread as uint)); assert!(read_val == write_val.to_owned()); } (*io).fs_unlink(&Path(path)); -- cgit 1.4.1-3-g733a5