Skip to content

Commit

Permalink
libcore: unify gen_<type> methods on rand::RngUtil into the gener…
Browse files Browse the repository at this point in the history
…ic `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.
  • Loading branch information
huonw committed Apr 24, 2013
1 parent 7b00921 commit 4a24f10
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 247 deletions.
2 changes: 1 addition & 1 deletion src/libcore/hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn resize_at(capacity: uint) -> uint {
pub fn linear_map_with_capacity<K:Eq + Hash,V>(
initial_capacity: uint) -> HashMap<K, V> {
let r = rand::task_rng();
linear_map_with_capacity_and_keys((*r).gen_u64(), (*r).gen_u64(),
linear_map_with_capacity_and_keys(r.gen(), r.gen(),
initial_capacity)
}

Expand Down
Loading

0 comments on commit 4a24f10

Please sign in to comment.