From 2b394a7d1d98b7633eeed2f8fa346e240ff4b555 Mon Sep 17 00:00:00 2001 From: Vinzent Steinberg Date: Thu, 12 Jul 2018 16:09:52 +0200 Subject: [PATCH] Document `WeightedError` --- src/distributions/weighted.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/distributions/weighted.rs b/src/distributions/weighted.rs index 64d862987c3..88389e87a26 100644 --- a/src/distributions/weighted.rs +++ b/src/distributions/weighted.rs @@ -169,10 +169,14 @@ mod test { } } +/// Error type of weighted distribution. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum WeightedError { + /// No items found. NoItem, + /// Item has negative weight. NegativeWeight, + /// All items had weight zero. AllWeightsZero, }