about summary refs log tree commit diff
path: root/src/libstd/ffi
diff options
context:
space:
mode:
authorTshepang Lekhonkhobe <tshepang@gmail.com>2015-02-28 20:07:05 +0200
committerTshepang Lekhonkhobe <tshepang@gmail.com>2015-03-01 09:35:57 +0200
commit55ce45e7b52a0a360cf88cba71f59f7d3e9b2346 (patch)
tree5c49becf849c32f717a60f05f3bf62f7a02db78c /src/libstd/ffi
parent890293655251c372ea99694c0c9f0795e2663286 (diff)
downloadrust-55ce45e7b52a0a360cf88cba71f59f7d3e9b2346.tar.gz
rust-55ce45e7b52a0a360cf88cba71f59f7d3e9b2346.zip
remove some compiler warnings
Diffstat (limited to 'src/libstd/ffi')
-rw-r--r--src/libstd/ffi/c_str.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index 69bcc82f682..c94edb9d2a1 100644
--- a/src/libstd/ffi/c_str.rs
+++ b/src/libstd/ffi/c_str.rs
@@ -422,15 +422,14 @@ mod tests {
     use prelude::v1::*;
     use super::*;
     use libc;
-    use mem;
 
     #[test]
     fn c_to_rust() {
         let data = b"123\0";
         let ptr = data.as_ptr() as *const libc::c_char;
         unsafe {
-            assert_eq!(c_str_to_bytes(&ptr), b"123");
-            assert_eq!(c_str_to_bytes_with_nul(&ptr), b"123\0");
+            assert_eq!(CStr::from_ptr(ptr).to_bytes(), b"123");
+            assert_eq!(CStr::from_ptr(ptr).to_bytes_with_nul(), b"123\0");
         }
     }