Change assert to debug_assert

This commit is contained in:
2024-04-03 09:44:41 +02:00
parent db743bc417
commit 02ae2f0977

View File

@@ -23,12 +23,12 @@ impl<'a> Game<'a> {
weights: &'a [Vec<f64>], weights: &'a [Vec<f64>],
p_draw: f64, p_draw: f64,
) -> Self { ) -> Self {
assert!( debug_assert!(
(result.len() == teams.len()), (result.len() == teams.len()),
"result must have the same length as teams" "result must have the same length as teams"
); );
assert!( debug_assert!(
weights weights
.iter() .iter()
.zip(teams.iter()) .zip(teams.iter())
@@ -36,12 +36,12 @@ impl<'a> Game<'a> {
"weights must have the same dimensions as teams" "weights must have the same dimensions as teams"
); );
assert!( debug_assert!(
(0.0..1.0).contains(&p_draw), (0.0..1.0).contains(&p_draw),
"draw probability.must be >= 0.0 and < 1.0" "draw probability.must be >= 0.0 and < 1.0"
); );
assert!( debug_assert!(
p_draw > 0.0 || { p_draw > 0.0 || {
let mut r = result.to_vec(); let mut r = result.to_vec();
r.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap()); r.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());