Skip to content

Commit e9f1b58

Browse files
authored
Lint for iterations over hash types (typst#6652)
1 parent 7278d88 commit e9f1b58

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ strip = true
159159
[workspace.lints.clippy]
160160
blocks_in_conditions = "allow"
161161
comparison_chain = "allow"
162+
iter_over_hash_type = "warn"
162163
manual_range_contains = "allow"
163164
mutable_key_type = "allow"
164165
uninlined_format_args = "warn"

crates/typst-cli/src/watch.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ impl Watcher {
139139
fn update(&mut self, iter: impl IntoIterator<Item = PathBuf>) -> StrResult<()> {
140140
// Mark all files as not "seen" so that we may unwatch them if they
141141
// aren't in the dependency list.
142+
#[allow(clippy::iter_over_hash_type, reason = "order does not matter")]
142143
for seen in self.watched.values_mut() {
143144
*seen = false;
144145
}

crates/typst-cli/src/world.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ impl SystemWorld {
173173

174174
/// Reset the compilation state in preparation of a new compilation.
175175
pub fn reset(&mut self) {
176+
#[allow(clippy::iter_over_hash_type, reason = "order does not matter")]
176177
for slot in self.slots.get_mut().values_mut() {
177178
slot.reset();
178179
}

0 commit comments

Comments
 (0)