refactor: apply clippy recos for rustc 1.98.0

This commit is contained in:
Edouard Vanbelle
2026-08-21 14:27:42 +02:00
parent 8cd25d7e0f
commit cc3be1ec38
3 changed files with 45 additions and 4 deletions
+6 -2
View File
@@ -43,9 +43,13 @@ fn stats(mut s: Vec<f64>) -> (f64, f64, f64) {
/// Mirror of `face_pg_repository::bytes_to_embedding` — the per-face
/// `Vec<f32>` decode the BEFORE path pays for a column it never reads.
/// Kept byte-for-byte identical to the shipped path so the benchmark
/// measures apples-to-apples; `as_chunks` swap matches the source.
fn bytes_to_embedding(b: &[u8]) -> Vec<f32> {
b.chunks_exact(4)
.map(|c| f32::from_le_bytes([c[0], c[1], c[2], c[3]]))
b.as_chunks::<4>()
.0
.iter()
.map(|c| f32::from_le_bytes(*c))
.collect()
}