measure: replace map().flatten() with flat_map in epipolar test
- Commit
61bca127245b1611e0d1a9d194cb405bd6ba2b53- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-01 21:55 UTC (4 days ago)
- Parents
6a140b7
Workspace clippy (map_flatten) flagged the residual-matrix helper in the epipolar tests. flat_map with the same inner map yields the identical element sequence into the same fold. Verified: cargo clippy -p measure_cv --all-targets clean, cargo test -p measure_cv green, cargo fmt --check clean.
Diff
measure/src/main/rust/src/epipolar_tests.rs
diff --git a/measure/src/main/rust/src/epipolar_tests.rs b/measure/src/main/rust/src/epipolar_tests.rsindex e3422c8c34..af55547288 100644--- a/measure/src/main/rust/src/epipolar_tests.rs+++ b/measure/src/main/rust/src/epipolar_tests.rs@@ -51,8 +51,7 @@ fn t_dir_dot(t1: &Vector3<f64>, t2: &Vector3<f64>) -> f64 { fn max_r_err(r: &Matrix3<f64>, want: &Matrix3<f64>) -> f64 { (0..3)- .map(|i| (0..3).map(move |j| (r[(i, j)] - want[(i, j)]).abs()))- .flatten()+ .flat_map(|i| (0..3).map(move |j| (r[(i, j)] - want[(i, j)]).abs())) .fold(0.0f64, f64::max) }