about summary refs log tree commit diff
path: root/src/libstd/ffi
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-08-11 17:27:05 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-08-12 14:55:17 -0700
commit8d90d3f36871a00023cc1f313f91e351c287ca15 (patch)
tree2d9b616a2468117aa3afe1f6b1f910ff3116776b /src/libstd/ffi
parentd07d465cf60033e35eba16b9e431471d54c712f4 (diff)
downloadrust-8d90d3f36871a00023cc1f313f91e351c287ca15.tar.gz
rust-8d90d3f36871a00023cc1f313f91e351c287ca15.zip
Remove all unstable deprecated functionality
This commit removes all unstable and deprecated functions in the standard
library. A release was recently cut (1.3) which makes this a good time for some
spring cleaning of the deprecated functions.
Diffstat (limited to 'src/libstd/ffi')
-rw-r--r--src/libstd/ffi/c_str.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index 3e503074ab4..f99d3c14ed8 100644
--- a/src/libstd/ffi/c_str.rs
+++ b/src/libstd/ffi/c_str.rs
@@ -468,6 +468,7 @@ mod tests {
     use super::*;
     use libc;
     use borrow::Cow::{Borrowed, Owned};
+    use hash::{SipHasher, Hash, Hasher};
 
     #[test]
     fn c_to_rust() {
@@ -545,15 +546,16 @@ mod tests {
 
     #[test]
     fn equal_hash() {
-        use hash;
-
         let data = b"123\xE2\xFA\xA6\0";
         let ptr = data.as_ptr() as *const libc::c_char;
         let cstr: &'static CStr = unsafe { CStr::from_ptr(ptr) };
 
-        let cstr_hash = hash::hash::<_, hash::SipHasher>(&cstr);
-        let cstring_hash =
-            hash::hash::<_, hash::SipHasher>(&CString::new(&data[..data.len() - 1]).unwrap());
+        let mut s = SipHasher::new_with_keys(0, 0);
+        cstr.hash(&mut s);
+        let cstr_hash = s.finish();
+        let mut s = SipHasher::new_with_keys(0, 0);
+        CString::new(&data[..data.len() - 1]).unwrap().hash(&mut s);
+        let cstring_hash = s.finish();
 
         assert_eq!(cstr_hash, cstring_hash);
     }