From 6709eaba2a2110b0df574460af7b2eb66e79ebf1 Mon Sep 17 00:00:00 2001 From: Johann Hemmann Date: Fri, 19 Jan 2024 14:15:24 +0100 Subject: [PATCH] never_loop --- crates/parser/src/tests/sourcegen_inline_tests.rs | 2 +- crates/rust-analyzer/tests/slow-tests/tidy.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/parser/src/tests/sourcegen_inline_tests.rs b/crates/parser/src/tests/sourcegen_inline_tests.rs index 54e85c0734..bd9e188e4d 100644 --- a/crates/parser/src/tests/sourcegen_inline_tests.rs +++ b/crates/parser/src/tests/sourcegen_inline_tests.rs @@ -22,7 +22,7 @@ fn sourcegen_parser_tests() { } // ok is never actually read, but it needs to be specified to create a Test in existing_tests let existing = existing_tests(&tests_dir, true); - for t in existing.keys().filter(|&t| !tests.contains_key(t)) { + if let Some(t) = existing.keys().find(|&t| !tests.contains_key(t)) { panic!("Test is deleted: {t}"); } diff --git a/crates/rust-analyzer/tests/slow-tests/tidy.rs b/crates/rust-analyzer/tests/slow-tests/tidy.rs index dba336ea7d..db192cf8fe 100644 --- a/crates/rust-analyzer/tests/slow-tests/tidy.rs +++ b/crates/rust-analyzer/tests/slow-tests/tidy.rs @@ -379,7 +379,7 @@ impl TidyDocs { ) } - for path in self.contains_fixme { + if let Some(path) = self.contains_fixme.first() { panic!("FIXME doc in a fully-documented crate: {}", path.display()) } }