From f3f24ef189094bbaea12e12132307ae4d118a64b Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 18 Oct 2026 09:42:33 -0400 Subject: [PATCH] Land batch: fix clippy lints and the #1424 test after #1413 changed layer_menu Co-Authored-By: Claude Opus 5.5 --- crates/media/tests/tga.rs | 4 ++-- crates/text/src/font_dirs.rs | 2 +- crates/ui-egui/src/panels/timeline.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/media/tests/tga.rs b/crates/media/tests/tga.rs index 61aacd95..13a1f756 100644 --- a/crates/media/tests/tga.rs +++ b/crates/media/tests/tga.rs @@ -16,8 +16,8 @@ fn tga(pixels: [[u8; 4]; 4], alpha: bool, rle: bool, top: bool) -> Vec { bytes[14] = 2; bytes[16] = if alpha { 32 } else { 24 }; bytes[17] = if top { 0x20 } else { 0 } | if alpha { 8 } else { 0 }; - let order = if top { [0, 1, 2, 3] } else { [2, 3, 0, 1] }; - for row in order.chunks_exact(2) { + let rows = if top { [[0, 1], [2, 3]] } else { [[2, 3], [0, 1]] }; + for row in rows { if rle { assert_eq!(pixels[row[0]], pixels[row[1]]); bytes.push(0x81); // A two-pixel run. diff --git a/crates/text/src/font_dirs.rs b/crates/text/src/font_dirs.rs index 8004a62c..0561d8f8 100644 --- a/crates/text/src/font_dirs.rs +++ b/crates/text/src/font_dirs.rs @@ -498,7 +498,7 @@ mod tests { write(&first, "/unreadable/fonts"); write(&second, "/readable/fonts"); let _cleanup = Cleanup { root: root.clone(), file: first.clone(), permissions: std::fs::metadata(&first).unwrap().permissions() }; - std::fs::set_permissions(&first, std::fs::Permissions::from_mode(0)).unwrap(); + std::fs::set_permissions(&first, std::fs::Permissions::from_mode(0o000)).unwrap(); if std::fs::File::open(&first).is_ok() { eprintln!("skipped: this process can read mode-000 files"); return; diff --git a/crates/ui-egui/src/panels/timeline.rs b/crates/ui-egui/src/panels/timeline.rs index 0f292386..e9660da3 100644 --- a/crates/ui-egui/src/panels/timeline.rs +++ b/crates/ui-egui/src/panels/timeline.rs @@ -4649,12 +4649,12 @@ mod tests { #[test] fn the_layer_context_menu_draws_in_the_interface_language() { let caps = LayerMenuCaps { vector: true, text: false }; - let mut actions = Vec::new(); + let (mut auto, mut actions) = (crate::automation::Registry::default(), Vec::new()); crate::i18n::set_current("zh-hans"); - let menu = drawn_text(|ui| layer_menu(ui, &[7], caps, &mut actions)); + let menu = drawn_text(|ui| layer_menu(ui, &[7], caps, (&mut auto, "t"), &mut actions)); let effects = drawn_text(|ui| effects_submenu(ui, &[7], &mut |_: &mut egui::Ui, _: &str, _: &str, _: serde_json::Value| {})); crate::i18n::set_current("en"); - let english = drawn_text(|ui| layer_menu(ui, &[7], caps, &mut actions)); + let english = drawn_text(|ui| layer_menu(ui, &[7], caps, (&mut auto, "t"), &mut actions)); for label in ["新建", "图层设置...", "从矢量图层创建形状", "预合成...", "重复", "拆分图层", "删除"] { assert!(menu.iter().any(|t| t == label), "{label} missing from {menu:?}"); }