libcore: Remove mutable fields from rand.

This commit is contained in:
Patrick Walton
2013-05-02 23:09:50 -07:00
parent ee78d811e4
commit b2d1ac100f
6 changed files with 107 additions and 90 deletions

View File

@@ -13,7 +13,7 @@
use core::rand::RngUtil;
pub fn mkdtemp(tmpdir: &Path, suffix: &str) -> Option<Path> {
let r = rand::rng();
let mut r = rand::rng();
for 1000.times {
let p = tmpdir.push(r.gen_str(16) + suffix);
if os::make_dir(&p, 0x1c0) { // 700

View File

@@ -688,7 +688,7 @@ pub mod bench {
// not met, it may run as long as the Go algorithm.
pub fn auto_bench(&mut self, f: &fn(&mut BenchHarness)) -> ~[f64] {
let rng = rand::rng();
let mut rng = rand::rng();
let mut magnitude = 10;
let mut prev_madp = 0.0;