about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-03-02 12:59:35 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-03-12 11:31:43 +1100
commit689f19722fabd9aab61e826e00140a7fe7084afa (patch)
treef1b124415b95601fb001fe922b4e98b62f893c78 /src/libstd
parent198caa87cd870f8fd52bf0bd5fe471cf439c12f0 (diff)
downloadrust-689f19722fabd9aab61e826e00140a7fe7084afa.tar.gz
rust-689f19722fabd9aab61e826e00140a7fe7084afa.zip
rand: deprecate `rng`.
This should be called far less than it is because it does expensive OS
interactions and seeding of the internal RNG, `task_rng` amortises this
cost. The main problem is the name is so short and suggestive.

The direct equivalent is `StdRng::new`, which does precisely the same
thing.

The deprecation will make migrating away from the function easier.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/os.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/os.rs b/src/libstd/os.rs
index 8efa9763ba9..e529daaa500 100644
--- a/src/libstd/os.rs
+++ b/src/libstd/os.rs
@@ -1409,7 +1409,7 @@ mod tests {
     }
 
     fn make_rand_name() -> ~str {
-        let mut rng = rand::rng();
+        let mut rng = rand::task_rng();
         let n = ~"TEST" + rng.gen_ascii_str(10u);
         assert!(getenv(n).is_none());
         n