diff --git a/rand_distr/src/utils.rs b/rand_distr/src/utils.rs index f65fe19dc28..478aacf7625 100644 --- a/rand_distr/src/utils.rs +++ b/rand_distr/src/utils.rs @@ -246,13 +246,17 @@ pub(crate) fn log_gamma(x: f64) -> f64 { // size from force-inlining. #[inline(always)] pub(crate) fn ziggurat( - rng: &mut R, - symmetric: bool, - x_tab: ziggurat_tables::ZigTable, - f_tab: ziggurat_tables::ZigTable, - mut pdf: P, - mut zero_case: Z) - -> f64 where P: FnMut(f64) -> f64, Z: FnMut(&mut R, f64) -> f64 { + rng: &mut R, + symmetric: bool, + x_tab: ziggurat_tables::ZigTable, + f_tab: ziggurat_tables::ZigTable, + mut pdf: P, + mut zero_case: Z +) -> f64 +where + P: FnMut(f64) -> f64, + Z: FnMut(&mut R, f64) -> f64, +{ loop { // As an optimisation we re-implement the conversion to a f64. // From the remaining 12 most significant bits we use 8 to construct `i`. diff --git a/src/distributions/utils.rs b/src/distributions/utils.rs index eb5074eae3f..2d36b022658 100644 --- a/src/distributions/utils.rs +++ b/src/distributions/utils.rs @@ -497,13 +497,17 @@ pub fn log_gamma(x: f64) -> f64 { #[cfg(feature = "std")] #[inline(always)] pub fn ziggurat( - rng: &mut R, - symmetric: bool, - x_tab: ziggurat_tables::ZigTable, - f_tab: ziggurat_tables::ZigTable, - mut pdf: P, - mut zero_case: Z) - -> f64 where P: FnMut(f64) -> f64, Z: FnMut(&mut R, f64) -> f64 { + rng: &mut R, + symmetric: bool, + x_tab: ziggurat_tables::ZigTable, + f_tab: ziggurat_tables::ZigTable, + mut pdf: P, + mut zero_case: Z +) -> f64 +where + P: FnMut(f64) -> f64, + Z: FnMut(&mut R, f64) -> f64, +{ use crate::distributions::float::IntoFloat; loop { // As an optimisation we re-implement the conversion to a f64.