@@ -56,6 +56,7 @@ use rand_core::{RngCore, Error, impls};
56
56
/// [`EntropyRng`]: struct.EntropyRng.html
57
57
58
58
#[ allow( unused) ] // not used by all targets
59
+ #[ derive( Clone ) ]
59
60
pub struct OsRng ( imp:: OsRng ) ;
60
61
61
62
impl fmt:: Debug for OsRng {
@@ -149,10 +150,10 @@ mod imp {
149
150
use std:: io:: Read ;
150
151
use std:: sync:: { Once , Mutex , ONCE_INIT } ;
151
152
152
- #[ derive( Debug ) ]
153
+ #[ derive( Clone , Debug ) ]
153
154
pub struct OsRng ( OsRngMethod ) ;
154
155
155
- #[ derive( Debug ) ]
156
+ #[ derive( Clone , Debug ) ]
156
157
enum OsRngMethod {
157
158
GetRandom ,
158
159
RandomDevice ,
@@ -373,7 +374,7 @@ mod imp {
373
374
374
375
use { Error , ErrorKind } ;
375
376
376
- #[ derive( Debug ) ]
377
+ #[ derive( Clone , Debug ) ]
377
378
pub struct OsRng ;
378
379
379
380
impl OsRng {
@@ -408,7 +409,7 @@ mod imp {
408
409
use std:: io;
409
410
use self :: libc:: { c_int, size_t} ;
410
411
411
- #[ derive( Debug ) ]
412
+ #[ derive( Clone , Debug ) ]
412
413
pub struct OsRng ;
413
414
414
415
enum SecRandom { }
@@ -452,7 +453,7 @@ mod imp {
452
453
use std:: ptr;
453
454
use std:: io;
454
455
455
- #[ derive( Debug ) ]
456
+ #[ derive( Clone , Debug ) ]
456
457
pub struct OsRng ;
457
458
458
459
impl OsRng {
@@ -490,7 +491,7 @@ mod imp {
490
491
491
492
use std:: io;
492
493
493
- #[ derive( Debug ) ]
494
+ #[ derive( Clone , Debug ) ]
494
495
pub struct OsRng ;
495
496
496
497
impl OsRng {
@@ -524,7 +525,7 @@ mod imp {
524
525
use std:: io:: ErrorKind :: * ;
525
526
use std:: sync:: { Once , Mutex , ONCE_INIT } ;
526
527
527
- #[ derive( Debug ) ]
528
+ #[ derive( Clone , Debug ) ]
528
529
pub struct OsRng ( ) ;
529
530
530
531
// TODO: remove outer Option when `Mutex::new(None)` is a constant expression
@@ -584,7 +585,7 @@ mod imp {
584
585
585
586
use std:: io;
586
587
587
- #[ derive( Debug ) ]
588
+ #[ derive( Clone , Debug ) ]
588
589
pub struct OsRng ;
589
590
590
591
impl OsRng {
@@ -624,7 +625,7 @@ mod imp {
624
625
use self :: winapi:: um:: ntsecapi:: RtlGenRandom ;
625
626
use self :: winapi:: um:: winnt:: PVOID ;
626
627
627
- #[ derive( Debug ) ]
628
+ #[ derive( Clone , Debug ) ]
628
629
pub struct OsRng ;
629
630
630
631
impl OsRng {
@@ -657,7 +658,7 @@ mod imp {
657
658
mod imp {
658
659
use { Error , ErrorKind } ;
659
660
660
- #[ derive( Debug ) ]
661
+ #[ derive( Clone , Debug ) ]
661
662
pub struct OsRng ;
662
663
663
664
impl OsRng {
@@ -682,13 +683,13 @@ mod imp {
682
683
use stdweb:: web:: error:: Error as WebError ;
683
684
use { Error , ErrorKind } ;
684
685
685
- #[ derive( Debug ) ]
686
+ #[ derive( Clone , Debug ) ]
686
687
enum OsRngInner {
687
688
Browser ,
688
689
Node
689
690
}
690
691
691
- #[ derive( Debug ) ]
692
+ #[ derive( Clone , Debug ) ]
692
693
pub struct OsRng ( OsRngInner ) ;
693
694
694
695
impl OsRng {
0 commit comments