diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-03-02 12:59:35 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-03-12 11:31:43 +1100 |
| commit | 689f19722fabd9aab61e826e00140a7fe7084afa (patch) | |
| tree | f1b124415b95601fb001fe922b4e98b62f893c78 /src/libflate/lib.rs | |
| parent | 198caa87cd870f8fd52bf0bd5fe471cf439c12f0 (diff) | |
| download | rust-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/libflate/lib.rs')
| -rw-r--r-- | src/libflate/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libflate/lib.rs b/src/libflate/lib.rs index 17c96f1c5ab..6bf5092bb2d 100644 --- a/src/libflate/lib.rs +++ b/src/libflate/lib.rs @@ -97,7 +97,7 @@ mod tests { #[test] fn test_flate_round_trip() { - let mut r = rand::rng(); + let mut r = rand::task_rng(); let mut words = ~[]; for _ in range(0, 20) { let range = r.gen_range(1u, 10); |
