From 02ae2f09772a6d803d61bf65c38d41ffa082ea79 Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Wed, 3 Apr 2024 09:44:41 +0200 Subject: [PATCH] Change assert to debug_assert --- src/game.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game.rs b/src/game.rs index 1eac357..7fe08f4 100644 --- a/src/game.rs +++ b/src/game.rs @@ -23,12 +23,12 @@ impl<'a> Game<'a> { weights: &'a [Vec], p_draw: f64, ) -> Self { - assert!( + debug_assert!( (result.len() == teams.len()), "result must have the same length as teams" ); - assert!( + debug_assert!( weights .iter() .zip(teams.iter()) @@ -36,12 +36,12 @@ impl<'a> Game<'a> { "weights must have the same dimensions as teams" ); - assert!( + debug_assert!( (0.0..1.0).contains(&p_draw), "draw probability.must be >= 0.0 and < 1.0" ); - assert!( + debug_assert!( p_draw > 0.0 || { let mut r = result.to_vec(); r.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());