Skip to content

Commit e2af7ed

Browse files
committed
ndarray-rand: document panics
1 parent 721fb59 commit e2af7ed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ndarray-rand/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ pub trait RandomExt<S, D>
3535
/// Create an array with shape `dim` with elements drawn from
3636
/// `distribution` using the default rng.
3737
///
38+
/// ***Panics*** if the number of elements overflows usize.
39+
///
3840
/// ```
3941
/// extern crate rand;
4042
/// extern crate ndarray;
@@ -56,6 +58,8 @@ pub trait RandomExt<S, D>
5658

5759
/// Create an array with shape `dim` with elements drawn from
5860
/// `distribution`, using a specific Rng `rng`.
61+
///
62+
/// ***Panics*** if the number of elements overflows usize.
5963
fn random_using<IdS, R>(dim: D, distribution: IdS, rng: &mut R) -> ArrayBase<S, D>
6064
where IdS: IndependentSample<S::Elem>,
6165
R: Rng;

0 commit comments

Comments
 (0)