desktop tests: clippy clean (repeat_n in the tray test, unix-only time imports in ai_fix)

This commit is contained in:
CRTkafa 2026-10-23 14:47:53 +08:00
parent 84efa4e913
commit 0b0007045c
2 changed files with 2 additions and 1 deletions

View file

@ -3,6 +3,7 @@
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;
#[cfg(unix)]
use std::time::{Duration, Instant};
use storebound_desktop::ai_fix::*;

View file

@ -90,7 +90,7 @@ fn only_known_small_routes_are_remembered() {
#[test]
fn attention_dot_changes_only_the_corner() {
let (w, h) = (32u32, 32u32);
let base: Vec<u8> = std::iter::repeat([10u8, 20, 30, 255]).take((w * h) as usize).flatten().collect();
let base: Vec<u8> = std::iter::repeat_n([10u8, 20, 30, 255], (w * h) as usize).flatten().collect();
let out = with_attention_dot(&base, w, h);
assert_eq!(out.len(), base.len());
let at = |v: &[u8], x: u32, y: u32| -> [u8; 4] { let i = ((y * w + x) * 4) as usize; [v[i], v[i + 1], v[i + 2], v[i + 3]] };