From c2393765bf607c5c79828d095585c2f991ea9fee Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 24 Jul 2025 13:21:27 +0200 Subject: [PATCH] Lint for iterations over hash types --- Cargo.toml | 1 + crates/typst-cli/src/watch.rs | 1 + crates/typst-cli/src/world.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 500d116a6..259a8a9f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -159,6 +159,7 @@ strip = true [workspace.lints.clippy] blocks_in_conditions = "allow" comparison_chain = "allow" +iter_over_hash_type = "warn" manual_range_contains = "allow" mutable_key_type = "allow" uninlined_format_args = "warn" diff --git a/crates/typst-cli/src/watch.rs b/crates/typst-cli/src/watch.rs index 765f86808..151c0ca1d 100644 --- a/crates/typst-cli/src/watch.rs +++ b/crates/typst-cli/src/watch.rs @@ -139,6 +139,7 @@ impl Watcher { fn update(&mut self, iter: impl IntoIterator) -> StrResult<()> { // Mark all files as not "seen" so that we may unwatch them if they // aren't in the dependency list. + #[allow(clippy::iter_over_hash_type, reason = "order does not matter")] for seen in self.watched.values_mut() { *seen = false; } diff --git a/crates/typst-cli/src/world.rs b/crates/typst-cli/src/world.rs index 42083ef20..34ebda64b 100644 --- a/crates/typst-cli/src/world.rs +++ b/crates/typst-cli/src/world.rs @@ -173,6 +173,7 @@ impl SystemWorld { /// Reset the compilation state in preparation of a new compilation. pub fn reset(&mut self) { + #[allow(clippy::iter_over_hash_type, reason = "order does not matter")] for slot in self.slots.get_mut().values_mut() { slot.reset(); }