We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7806180 commit eade784Copy full SHA for eade784
src/libstd/map.rs
@@ -384,7 +384,7 @@ Function: new_int_hash
384
Construct a hashmap for int keys
385
*/
386
fn new_int_hash<V: copy>() -> hashmap<int, V> {
387
- fn hash_int(&&x: int) -> uint { ret x as uint; }
+ fn hash_int(&&x: int) -> uint { int::hash(x) }
388
fn eq_int(&&a: int, &&b: int) -> bool { ret a == b; }
389
ret mk_hashmap(hash_int, eq_int);
390
}
@@ -395,7 +395,7 @@ Function: new_uint_hash
395
Construct a hashmap for uint keys
396
397
fn new_uint_hash<V: copy>() -> hashmap<uint, V> {
398
- fn hash_uint(&&x: uint) -> uint { ret x; }
+ fn hash_uint(&&x: uint) -> uint { uint::hash(x) }
399
fn eq_uint(&&a: uint, &&b: uint) -> bool { ret a == b; }
400
ret mk_hashmap(hash_uint, eq_uint);
401
0 commit comments