From 4924bc8b57c466ff982532a821d1708ab6326b26 Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Tue, 8 Sep 2026 01:39:21 +0200 Subject: [PATCH] style: use arrays rather than vec! in the calibration fixture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clippy::useless_vec. Pushed broken because the verification chain used `if ... then echo` blocks that report status without gating the `&&` that follows — the same shape of mistake as e1bddf2, where a grep succeeded on the error text. Both times the check printed FAIL and the push went ahead. The reliable form is a single fail-fast chain: just lint && just test && just determinism && cargo test --doc so nothing runs after the first failure. --- tests/marginal_calibration.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/marginal_calibration.rs b/tests/marginal_calibration.rs index 229b601..32c52e8 100644 --- a/tests/marginal_calibration.rs +++ b/tests/marginal_calibration.rs @@ -100,7 +100,7 @@ fn inverse(mut a: Vec>) -> Vec> { /// precision = prior precision + sum of a_k a_k^T / v_k. fn exact_for(obs: &[(usize, usize, f64)]) -> (Vec, Vec>) { let mut lambda = vec![vec![0.0; N]; N]; - let mut eta = vec![0.0; N]; + let mut eta = [0.0; N]; for (i, row) in lambda.iter_mut().enumerate() { row[i] = 1.0 / (SIGMA0 * SIGMA0); eta[i] = MU0 / (SIGMA0 * SIGMA0); @@ -109,7 +109,7 @@ fn exact_for(obs: &[(usize, usize, f64)]) -> (Vec, Vec>) { // Each 1v1 observation: d ~ N(x_a - x_b, score_sigma^2 + 2 beta^2) let v = SCORE_SIGMA * SCORE_SIGMA + 2.0 * BETA * BETA; for &(a, b, d) in obs { - let mut vec_a = vec![0.0; N]; + let mut vec_a = [0.0; N]; vec_a[a] = 1.0; vec_a[b] = -1.0; for i in 0..N {