Skip to content

Commit 4c61e38

Browse files
Fix clippy warnings: remove unnecessary parentheses and useless comparison
- src/simd_int_ops.rs: remove redundant parens in closure bodies (lines 287, 288) - src/hpc/vml.rs: remove redundant parens in closure body (line 478) - src/hpc/vnni_gemm.rs: remove redundant parens in closure body (line 318) - src/hpc/renderer.rs: replace useless >= 0 comparison on u64 with assert_eq!(_, 0) Co-authored-by: AdaWorldAPI <AdaWorldAPI@users.noreply.github.com>
1 parent c827ca8 commit 4c61e38

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/hpc/renderer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ mod tests {
425425
let _ = &*GLOBAL_RENDERER;
426426
// First-touch: tick count is 0; capacity is at least 4096
427427
// (could be greater if PREFERRED_F32_LANES > 16 at some future tier).
428-
assert!(GLOBAL_RENDERER.tick_count() >= 0);
428+
assert_eq!(GLOBAL_RENDERER.tick_count(), 0);
429429
let f = GLOBAL_RENDERER.read_front();
430430
assert!(f.capacity >= 4096);
431431
}

src/hpc/vml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ mod tests {
475475

476476
// Generate "weight" data (deterministic, mimics Gaussian distribution)
477477
let weights: Vec<f64> = (0..d)
478-
.map(|i| ((i as f64 * 0.7 + 13.0).sin() * 2.5))
478+
.map(|i| (i as f64 * 0.7 + 13.0).sin() * 2.5)
479479
.collect();
480480

481481
// ── ENCODING: f64[4096] → f64[17] (golden-step projection) ──

src/hpc/vnni_gemm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ mod tests {
315315
let n = 5;
316316
let k = 8;
317317
let a: Vec<u8> = (0..m * k).map(|i| (i % 200) as u8).collect();
318-
let b: Vec<i8> = (0..k * n).map(|i| ((i % 100) as i8 - 50)).collect();
318+
let b: Vec<i8> = (0..k * n).map(|i| (i % 100) as i8 - 50).collect();
319319
let expected = scalar_gemm(&a, &b, m, n, k);
320320
let mut c = vec![0i32; m * n];
321321
int8_gemm_vnni(&a, &b, &mut c, m, n, k);

src/simd_int_ops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ mod tests {
284284
#[test]
285285
fn add_i16_matches_scalar_for_tail_lengths() {
286286
for &len in &[0usize, 1, 31, 32, 33, 64, 65, 100] {
287-
let a_init: Vec<i16> = (0..len).map(|i| (i as i16 * 7 - 1000)).collect();
288-
let b: Vec<i16> = (0..len).map(|i| (i as i16 * -3 + 500)).collect();
287+
let a_init: Vec<i16> = (0..len).map(|i| i as i16 * 7 - 1000).collect();
288+
let b: Vec<i16> = (0..len).map(|i| i as i16 * -3 + 500).collect();
289289

290290
let mut a_simd = a_init.clone();
291291
add_i16(&mut a_simd, &b);

0 commit comments

Comments
 (0)