1
Fork 0

De-duplicate core::hash some, refactor the traits.

This commit is contained in:
Graydon Hoare 2012-08-02 17:17:31 -07:00
parent 009352101d
commit 4779d2b392
5 changed files with 229 additions and 222 deletions

View file

@ -8,6 +8,7 @@
*/
import libc::size_t;
import io::writer_util;
export
// Creating a string
@ -665,10 +666,7 @@ pure fn le(a: &~str, b: &~str) -> bool { *a <= *b }
/// String hash function
pure fn hash(s: &~str) -> uint {
let x = do as_bytes(*s) |bytes| {
hash::hash_bytes(bytes)
};
return x as uint;
hash::hash_str(*s) as uint
}
/*