File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -39,24 +39,30 @@ impl BaseRng for GlobalRng {
3939
4040macro_rules! define_ext {
4141 ( $(
42+ $( #[ $meta: meta] ) *
4243 fn $name: ident( & mut self , $( $argname: ident: $argty: ty) ,* ) -> $ret: ty $bl: block
4344 ) * ) => {
45+ /// Extra methods for [`fastrand::Rng`].
4446 pub trait RngExt {
4547 $(
48+ $( #[ $meta] ) *
4649 fn $name( & mut self , $( $argname: $argty) ,* ) -> $ret;
4750 ) *
4851 }
4952
5053 impl RngExt for Rng {
5154 $(
55+ $( #[ $meta] ) *
5256 fn $name( & mut self , $( $argname: $argty) ,* ) -> $ret $bl
5357 ) *
5458 }
5559
5660 $(
5761 #[ cfg( feature = "std" ) ]
62+ $( #[ $meta] ) *
5863 pub fn $name( $( $argname: $argty) ,* ) -> $ret {
5964 impl GlobalRng {
65+ $( #[ $meta] ) *
6066 fn $name( & mut self , $( $argname: $argty) ,* ) -> $ret $bl
6167 }
6268
@@ -67,11 +73,13 @@ macro_rules! define_ext {
6773}
6874
6975define_ext ! {
76+ /// Generate a 32-bit floating point number in the specified range.
7077 fn f32_range( & mut self , range: impl RangeBounds <f32 >) -> f32 {
7178 let _ = range;
7279 todo!( )
7380 }
7481
82+ /// Generate a 64-bit floating point number in the specified range.
7583 fn f64_range( & mut self , range: impl RangeBounds <f64 >) -> f64 {
7684 let _ = range;
7785 todo!( )
You can’t perform that action at this time.
0 commit comments