]> git.lizzy.rs Git - rust.git/commit
rand: bubble up IO messages futher.
authorHuon Wilson <dbau.pp+github@gmail.com>
Tue, 25 Mar 2014 05:13:11 +0000 (16:13 +1100)
committerHuon Wilson <dbau.pp+github@gmail.com>
Tue, 1 Apr 2014 09:46:10 +0000 (20:46 +1100)
commitbc7a2d72a3fea324fa432de9b6ce6073302d3d8c
tree5291b4abea25c42302facd2cf2387003060ae376
parent0e8c949786539375ccb6ebe4af968c7cf5cebe43
rand: bubble up IO messages futher.

The various ...Rng::new() methods can hit IO errors from the OSRng they use,
and it seems sensible to expose them at a higher level. Unfortunately, writing
e.g. `StdRng::new().unwrap()` gives a much poorer error message than if it
failed internally, but this is a problem with all `IoResult`s.
14 files changed:
src/libcollections/deque.rs
src/libgreen/sched.rs
src/librand/distributions/exponential.rs
src/librand/distributions/gamma.rs
src/librand/distributions/normal.rs
src/librand/isaac.rs
src/librand/lib.rs
src/librand/os.rs
src/librand/reseeding.rs
src/libstd/fmt/num.rs
src/libstd/io/fs.rs
src/libstd/num/strconv.rs
src/libstd/rt/task.rs
src/test/bench/noise.rs