Skip to content

Commit 4a24f10

Browse files
committed
libcore: unify gen_<type> methods on rand::RngUtil into the generic gen.
This moves all the basic random value generation into the Rand instances for each type and then removes the `gen_int`, `gen_char` (etc) methods on RngUtil, leaving only the generic `gen` and the more specialised methods. Also, removes some imports that are redundant due to a `use core::prelude::*` statement.
1 parent 7b00921 commit 4a24f10

15 files changed

+106
-247
lines changed

src/libcore/hashmap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn resize_at(capacity: uint) -> uint {
5656
pub fn linear_map_with_capacity<K:Eq + Hash,V>(
5757
initial_capacity: uint) -> HashMap<K, V> {
5858
let r = rand::task_rng();
59-
linear_map_with_capacity_and_keys((*r).gen_u64(), (*r).gen_u64(),
59+
linear_map_with_capacity_and_keys(r.gen(), r.gen(),
6060
initial_capacity)
6161
}
6262

0 commit comments

Comments
 (0)