summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-03-25 16:13:11 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-04-01 20:46:10 +1100
commitbc7a2d72a3fea324fa432de9b6ce6073302d3d8c (patch)
tree5291b4abea25c42302facd2cf2387003060ae376 /src/libstd/io
parent0e8c949786539375ccb6ebe4af968c7cf5cebe43 (diff)
downloadrust-bc7a2d72a3fea324fa432de9b6ce6073302d3d8c.tar.gz
rust-bc7a2d72a3fea324fa432de9b6ce6073302d3d8c.zip
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.
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/fs.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs
index e66aa8c0046..63973584c1e 100644
--- a/src/libstd/io/fs.rs
+++ b/src/libstd/io/fs.rs
@@ -1285,7 +1285,7 @@ mod test {
         use rand::{StdRng, Rng};
 
         let mut bytes = [0, ..1024];
-        StdRng::new().fill_bytes(bytes);
+        StdRng::new().unwrap().fill_bytes(bytes);
 
         let tmpdir = tmpdir();