]> git.lizzy.rs Git - rust.git/commitdiff
int audit core::hash
authorNick Cameron <ncameron@mozilla.com>
Mon, 23 Feb 2015 03:12:40 +0000 (16:12 +1300)
committerNick Cameron <ncameron@mozilla.com>
Mon, 23 Feb 2015 03:12:40 +0000 (16:12 +1300)
src/libcore/hash/mod.rs
src/libcore/hash/sip.rs

index ed48903a7c2550ab31b5c415f71b389f331bb9f7..edc4b7e10ee49b04b024a3b3076d2f425f12358a 100644 (file)
@@ -20,7 +20,7 @@
 //!
 //! #[derive(Hash)]
 //! struct Person {
-//!     id: uint,
+//!     id: u32,
 //!     name: String,
 //!     phone: u64,
 //! }
@@ -38,7 +38,7 @@
 //! use std::hash::{hash, Hash, Hasher, SipHasher};
 //!
 //! struct Person {
-//!     id: uint,
+//!     id: u32,
 //!     name: String,
 //!     phone: u64,
 //! }
index 6f24fc7067344c3cb848a0f645142f90c4d9a24f..39bcbacdff182c23b137037d007099a58ca17ed8 100644 (file)
 pub struct SipHasher {
     k0: u64,
     k1: u64,
-    length: uint, // how many bytes we've processed
+    length: usize, // how many bytes we've processed
     v0: u64,      // hash state
     v1: u64,
     v2: u64,
     v3: u64,
     tail: u64, // unprocessed bytes le
-    ntail: uint,  // how many bytes in tail are valid
+    ntail: usize,  // how many bytes in tail are valid
 }
 
 // sadly, these macro definitions can't appear later,