Skip to content

Commit 38a702c

Browse files
committed
Add documentation support
Signed-off-by: John Nunley <[email protected]>
1 parent 387518c commit 38a702c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,30 @@ impl BaseRng for GlobalRng {
3939

4040
macro_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

6975
define_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!()

0 commit comments

Comments
 (0)