auto merge of #13115 : huonw/rust/rand-errors, r=alexcrichton

move errno -> IoError converter into std, bubble up OSRng errors

Also adds a general errno -> `~str` converter to `std::os`, and makes the failure messages for the things using `OSRng` (e.g. (transitively) the task-local RNG, meaning hashmap initialisation failures aren't such a black box).
This commit is contained in:
bors 2014-04-01 11:11:51 -07:00
commit b71c02e512
20 changed files with 216 additions and 158 deletions

View file

@ -41,7 +41,7 @@ struct Noise2DContext {
impl Noise2DContext {
fn new() -> Noise2DContext {
let mut rng = StdRng::new();
let mut rng = StdRng::new().unwrap();
let mut rgradients = [Vec2 { x: 0.0, y: 0.0 }, ..256];
for x in rgradients.mut_iter() {