File tree 1 file changed +2
-21
lines changed
1 file changed +2
-21
lines changed Original file line number Diff line number Diff line change @@ -843,27 +843,8 @@ pub trait NewSeeded: SeedableRng {
843
843
#[ cfg( feature="std" ) ]
844
844
impl < R : SeedableRng > NewSeeded for R {
845
845
fn new ( ) -> Result < Self , Error > {
846
- // Note: error handling would be easier with try/catch blocks
847
- fn new_os < T : SeedableRng > ( ) -> Result < T , Error > {
848
- let mut r = OsRng :: new ( ) ?;
849
- T :: from_rng ( & mut r)
850
- }
851
-
852
- fn new_jitter < T : SeedableRng > ( ) -> Result < T , Error > {
853
- let mut r = JitterRng :: new ( ) ?;
854
- T :: from_rng ( & mut r)
855
- }
856
-
857
- new_os ( ) . or_else ( |e1| {
858
- new_jitter ( ) . map_err ( |_e2| {
859
- // TODO: log
860
- // TODO: can we somehow return both error sources?
861
- Error :: with_cause (
862
- ErrorKind :: Unavailable ,
863
- "seeding a new RNG failed: both OS and Jitter entropy sources failed" ,
864
- e1)
865
- } )
866
- } )
846
+ let mut source = EntropySource :: new ( ) ?;
847
+ R :: from_rng ( & mut source)
867
848
}
868
849
}
869
850
You can’t perform that action at this time.
0 commit comments