diff options
author | Carl Lerche <me@carllerche.com> | 2015-03-25 10:52:05 -0700 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2015-03-25 10:52:05 -0700 |
commit | 0d5ea0b16dae98c13600d54889d065c2201fd3b6 (patch) | |
tree | 2813de9fb9fa1820fddb0e3f330714b61e40d628 /test/sys | |
parent | cc7b3c46997c7ee495a7877815ea098853fbcc17 (diff) | |
download | nix-0d5ea0b16dae98c13600d54889d065c2201fd3b6.zip |
Track Rust master
Diffstat (limited to 'test/sys')
-rw-r--r-- | test/sys/test_socket.rs | 2 | ||||
-rw-r--r-- | test/sys/test_uio.rs | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs index 97ee889d..3d04ac0a 100644 --- a/test/sys/test_socket.rs +++ b/test/sys/test_socket.rs @@ -30,7 +30,7 @@ pub fn test_path_to_sock_addr() { let actual = Path::new("/foo/bar"); let addr = UnixAddr::new(actual).unwrap(); - let expect: &'static [i8] = unsafe { mem::transmute(b"/foo/bar".as_slice()) }; + let expect: &'static [i8] = unsafe { mem::transmute(b"/foo/bar".as_ref()) }; assert_eq!(&addr.0.sun_path[..8], expect); assert_eq!(addr.path(), actual); diff --git a/test/sys/test_uio.rs b/test/sys/test_uio.rs index c90ce288..e27f3b2c 100644 --- a/test/sys/test_uio.rs +++ b/test/sys/test_uio.rs @@ -27,7 +27,7 @@ fn test_writev() { // FileDesc will close its filedesc (reader). let mut read_buf: Vec<u8> = iter::repeat(0u8).take(128 * 16).collect(); // Blocking io, should write all data. - let write_res = writev(writer, iovecs.as_slice()); + let write_res = writev(writer, &iovecs); // Successful write assert!(write_res.is_ok()); let written = write_res.ok().unwrap(); @@ -40,7 +40,7 @@ fn test_writev() { // Check we have read as much as we written assert_eq!(read, written); // Check equality of written and read data - assert_eq!(to_write.as_slice(), read_buf.as_slice()); + assert_eq!(&to_write, &read_buf); let close_res = close(writer); assert!(close_res.is_ok()); let close_res = close(reader); @@ -68,7 +68,7 @@ fn test_readv() { assert!(pipe_res.is_ok()); let (reader, writer) = pipe_res.ok().unwrap(); // Blocking io, should write all data. - let write_res = write(writer, to_write.as_slice()); + let write_res = write(writer, &to_write); // Successful write assert!(write_res.is_ok()); let read_res = readv(reader, iovecs.as_mut_slice()); @@ -84,7 +84,7 @@ fn test_readv() { // Check whether iovecs contain all written data assert_eq!(read_buf.len(), to_write.len()); // Check equality of written and read data - assert_eq!(read_buf.as_slice(), to_write.as_slice()); + assert_eq!(&read_buf, &to_write); let close_res = close(reader); assert!(close_res.is_ok()); let close_res = close(writer); |