about summary refs log tree commit diff
path: root/src/libstd/ffi
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-03-04 12:16:51 +0000
committerbors <bors@rust-lang.org>2015-03-04 12:16:51 +0000
commitbdf6e4fcf5ed8b8fe3c281040414e4f6a6afb8d6 (patch)
tree609f5fc3b538d928ad4f36691110c2928779c358 /src/libstd/ffi
parent6e055c3f0041067000dfae7bbc2b0383a8fed19e (diff)
parent55ce45e7b52a0a360cf88cba71f59f7d3e9b2346 (diff)
downloadrust-bdf6e4fcf5ed8b8fe3c281040414e4f6a6afb8d6.tar.gz
rust-bdf6e4fcf5ed8b8fe3c281040414e4f6a6afb8d6.zip
Auto merge of #22920 - tshepang:remove-some-warnings, r=huonw
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");
         }
     }