File tree 1 file changed +4
-26
lines changed
1 file changed +4
-26
lines changed Original file line number Diff line number Diff line change @@ -535,32 +535,9 @@ mod imp {
535
535
}
536
536
537
537
538
- #[ cfg( any( target_os = "dragonfly" , target_os = "haiku" ) ) ]
539
- mod imp {
540
- use Error ;
541
- use super :: random_device;
542
- use super :: OsRngImpl ;
543
- use std:: fs:: File ;
544
-
545
- #[ derive( Clone , Debug ) ]
546
- pub struct OsRng ( ) ;
547
-
548
- impl OsRngImpl for OsRng {
549
- fn new ( ) -> Result < OsRng , Error > {
550
- random_device:: open ( "/dev/random" , & |p| File :: open ( p) ) ?;
551
- Ok ( OsRng ( ) )
552
- }
553
-
554
- fn fill_chunk ( & mut self , dest : & mut [ u8 ] ) -> Result < ( ) , Error > {
555
- random_device:: read ( dest)
556
- }
557
-
558
- fn method_str ( & self ) -> & ' static str { "/dev/random" }
559
- }
560
- }
561
-
562
-
563
- #[ cfg( target_os = "emscripten" ) ]
538
+ #[ cfg( any( target_os = "dragonfly" ,
539
+ target_os = "haiku" ,
540
+ target_os = "emscripten" ) ) ]
564
541
mod imp {
565
542
use Error ;
566
543
use super :: random_device;
@@ -580,6 +557,7 @@ mod imp {
580
557
random_device:: read ( dest)
581
558
}
582
559
560
+ #[ cfg( target_os = "emscripten" ) ]
583
561
fn max_chunk_size ( & self ) -> usize {
584
562
// `Crypto.getRandomValues` documents `dest` should be at most 65536
585
563
// bytes. `crypto.randomBytes` documents: "To minimize threadpool
You can’t perform that action at this time.
0 commit comments