Skip to content

Commit 0e9cea9

Browse files
committed
refactor: simplify shebang removal logic in test_run_tests_php
1 parent bc8e842 commit 0e9cea9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/lexer_compliance.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,11 @@ fn test_run_tests_php() {
328328

329329
// If the first token is a shebang (T_INLINE_HTML starting with #!), remove it
330330
// because our lexer discards shebangs.
331-
if let Some((kind, text)) = php_tokens.first() {
332-
if kind == "T_INLINE_HTML" && text.starts_with("#!") {
333-
php_tokens.remove(0);
334-
}
331+
if php_tokens
332+
.first()
333+
.is_some_and(|(kind, text)| kind == "T_INLINE_HTML" && text.starts_with("#!"))
334+
{
335+
php_tokens.remove(0);
335336
}
336337

337338
let code = std::fs::read_to_string(&path).expect("Failed to read file");

0 commit comments

Comments
 (0)