File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -72,12 +72,12 @@ impl RngCore for CryptoProviderRng {
72
72
}
73
73
74
74
fn fill_bytes ( & mut self , dest : & mut [ u8 ] ) {
75
- self . try_fill_bytes ( dest) . unwrap ( )
75
+ self . try_fill_bytes ( dest) . expect ( "random bytes should be filled" )
76
76
}
77
77
78
78
fn try_fill_bytes ( & mut self , dest : & mut [ u8 ] ) -> Result < ( ) , rand_core:: Error > {
79
79
CryptoProvider :: get_default ( )
80
- . unwrap ( )
80
+ . expect ( "provider should be set" )
81
81
. secure_random
82
82
. fill ( dest)
83
83
. map_err ( |_| unsafe { NonZeroU32 :: new_unchecked ( 1 ) . into ( ) } )
@@ -93,7 +93,6 @@ struct OsRngSecureRandom;
93
93
#[ cfg( feature = "getrandom" ) ]
94
94
impl SecureRandom for OsRngSecureRandom {
95
95
fn fill ( & self , buf : & mut [ u8 ] ) -> Result < ( ) , GetRandomFailed > {
96
- use rand_core:: RngCore ;
97
96
rand_core:: OsRng
98
97
. try_fill_bytes ( buf)
99
98
. map_err ( |_| GetRandomFailed )
You can’t perform that action at this time.
0 commit comments