File tree 1 file changed +2
-26
lines changed
1 file changed +2
-26
lines changed Original file line number Diff line number Diff line change 43
43
44
44
use core:: default:: Default ;
45
45
use core:: convert:: AsMut ;
46
-
47
- #[ cfg( all( feature="alloc" , not( feature="std" ) ) ) ] use alloc:: boxed:: Box ;
46
+ use core:: ops:: DerefMut ;
48
47
49
48
pub use error:: { ErrorKind , Error } ;
50
49
@@ -262,30 +261,7 @@ pub trait SeedableRng: Sized {
262
261
}
263
262
264
263
265
- impl < ' a , R : RngCore + ?Sized > RngCore for & ' a mut R {
266
- #[ inline]
267
- fn next_u32 ( & mut self ) -> u32 {
268
- ( * * self ) . next_u32 ( )
269
- }
270
-
271
- #[ inline]
272
- fn next_u64 ( & mut self ) -> u64 {
273
- ( * * self ) . next_u64 ( )
274
- }
275
-
276
- #[ inline]
277
- fn fill_bytes ( & mut self , dest : & mut [ u8 ] ) {
278
- ( * * self ) . fill_bytes ( dest)
279
- }
280
-
281
- #[ inline]
282
- fn try_fill_bytes ( & mut self , dest : & mut [ u8 ] ) -> Result < ( ) , Error > {
283
- ( * * self ) . try_fill_bytes ( dest)
284
- }
285
- }
286
-
287
- #[ cfg( any( feature="std" , feature="alloc" ) ) ]
288
- impl < R : RngCore + ?Sized > RngCore for Box < R > {
264
+ impl < R : RngCore + ?Sized , T : DerefMut < Target = R > > RngCore for T {
289
265
#[ inline]
290
266
fn next_u32 ( & mut self ) -> u32 {
291
267
( * * self ) . next_u32 ( )
You can’t perform that action at this time.
0 commit comments