Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

test(automation): skip use lines in the file access scan

aiongg21c1c917a5bc
diff --git a/crates/automation/src/file_access.rs b/crates/automation/src/file_access.rs
index 3fa3a90ab..5003e1034 100644
--- a/crates/automation/src/file_access.rs
+++ b/crates/automation/src/file_access.rs
@@ -423,7 +423,9 @@ mod tests {
let lines: Vec<&str> = code.lines().collect();
for (n, line) in lines.iter().enumerate() {
let trimmed = line.trim_start();
+ // A `use` line only names a helper; the call is checked where it is made.
if trimmed.starts_with("//")
+ || trimmed.starts_with("use ")
|| !(trimmed.contains("std::fs")
|| trimmed.contains("File::open")
|| trimmed.contains("File::create")