From fab964d194c37bd0d2fdd49a284743b5a4103e75 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Thu, 2 Jan 2020 11:53:20 +0000 Subject: [PATCH] Manual function specification reformatting --- rand_distr/src/utils.rs | 18 +++++++++++------- src/distributions/utils.rs | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) 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.