diff options
| author | Florian Hahn <flo@fhahn.com> | 2013-09-05 14:17:24 +0200 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2013-09-05 14:17:24 +0200 |
| commit | de39874801761197bf10bf8d04bde1aa2bd82e15 (patch) | |
| tree | 6afb87492fa6c69778066aa748b26ecae1fb5262 /src/libstd/rt/uv | |
| parent | 422dcbd56d1a1888f1491d8fb14bb87a54fadbc7 (diff) | |
| download | rust-de39874801761197bf10bf8d04bde1aa2bd82e15.tar.gz rust-de39874801761197bf10bf8d04bde1aa2bd82e15.zip | |
Rename str::from_bytes to str::from_utf8, closes #8985
Diffstat (limited to 'src/libstd/rt/uv')
| -rw-r--r-- | src/libstd/rt/uv/file.rs | 4 | ||||
| -rw-r--r-- | src/libstd/rt/uv/net.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/uv/uvio.rs | 2 |
3 files changed, 4 insertions, 4 deletions
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<T>(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)); |
