Skip to content

Commit 6c0a7c7

Browse files
committed
libcore: remove @rng from rand, and use traits instead.
Also, rename RandRes -> IsaacRng, and make the constructors static methods.
1 parent 706096b commit 6c0a7c7

19 files changed

+205
-195
lines changed

src/libcore/flate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn inflate_bytes(bytes: &const [u8]) -> ~[u8] {
8585
#[test]
8686
#[allow(non_implicitly_copyable_typarams)]
8787
fn test_flate_round_trip() {
88-
let r = rand::Rng();
88+
let r = rand::rng();
8989
let mut words = ~[];
9090
for 20.times {
9191
words.push(r.gen_bytes(r.gen_uint_range(1, 10)));

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_u64(), (*r).gen_u64(),
6060
initial_capacity)
6161
}
6262

src/libcore/os.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ mod tests {
12591259
}
12601260
12611261
fn make_rand_name() -> ~str {
1262-
let rng: @rand::Rng = rand::Rng();
1262+
let rng = rand::rng();
12631263
let n = ~"TEST" + rng.gen_str(10u);
12641264
assert!(getenv(n).is_none());
12651265
n

0 commit comments

Comments
 (0)