Skip to content

Commit 729f38b

Browse files
clippy
1 parent 8067731 commit 729f38b

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

crates/djls-semantic/src/semantic/args.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ fn validate_literals(db: &dyn Db, tag_name: &str, bits: &[String], span: Span, a
149149
}
150150
}
151151

152+
#[allow(clippy::too_many_lines)]
152153
fn validate_choices_and_order(
153154
db: &dyn Db,
154155
tag_name: &str,
@@ -317,7 +318,7 @@ mod tests {
317318
use super::*;
318319

319320
// Helper to manually validate arguments without full database setup
320-
fn validate_args_simple(bits: Vec<String>, args: Vec<TagArg>) -> Vec<String> {
321+
fn validate_args_simple(bits: &[String], args: &[TagArg]) -> Vec<String> {
321322
let mut errors = Vec::new();
322323

323324
let has_varargs = args.iter().any(|arg| matches!(arg, TagArg::VarArgs { .. }));
@@ -440,7 +441,7 @@ mod tests {
440441
required: true,
441442
}];
442443

443-
let errors = validate_args_simple(bits, args);
444+
let errors = validate_args_simple(&bits, &args);
444445
assert!(
445446
errors.is_empty(),
446447
"Should not error on expression with multiple tokens: {errors:?}"
@@ -457,7 +458,7 @@ mod tests {
457458
required: true,
458459
}];
459460

460-
let errors = validate_args_simple(bits, args);
461+
let errors = validate_args_simple(&bits, &args);
461462
assert!(
462463
errors.is_empty(),
463464
"Should not error on quoted string: {errors:?}"
@@ -492,7 +493,7 @@ mod tests {
492493
},
493494
];
494495

495-
let errors = validate_args_simple(bits, args);
496+
let errors = validate_args_simple(&bits, &args);
496497
assert!(
497498
errors.is_empty(),
498499
"Should handle optional literal 'reversed': {errors:?}"
@@ -512,7 +513,7 @@ mod tests {
512513
required: true,
513514
}];
514515

515-
let errors = validate_args_simple(bits, args);
516+
let errors = validate_args_simple(&bits, &args);
516517
assert!(
517518
errors.is_empty(),
518519
"Should handle complex boolean expression: {errors:?}"
@@ -539,7 +540,7 @@ mod tests {
539540
},
540541
];
541542

542-
let errors = validate_args_simple(bits, args);
543+
let errors = validate_args_simple(&bits, &args);
543544
assert!(errors.is_empty(), "Should handle varargs: {errors:?}");
544545
}
545546

@@ -552,7 +553,7 @@ mod tests {
552553
required: true,
553554
}];
554555

555-
let errors = validate_args_simple(bits, args);
556+
let errors = validate_args_simple(&bits, &args);
556557
assert!(
557558
errors.is_empty(),
558559
"Should handle assignment with filter: {errors:?}"
@@ -568,7 +569,7 @@ mod tests {
568569
required: true,
569570
}];
570571

571-
let errors = validate_args_simple(bits, args);
572+
let errors = validate_args_simple(&bits, &args);
572573
assert!(errors.is_empty(), "Should handle quoted path: {errors:?}");
573574
}
574575

@@ -592,7 +593,7 @@ mod tests {
592593
},
593594
];
594595

595-
let errors = validate_args_simple(bits, args);
596+
let errors = validate_args_simple(&bits, &args);
596597
assert!(
597598
errors.is_empty(),
598599
"Expr should stop before literal keyword: {errors:?}"

crates/djls-templates/src/parser.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,15 @@ fn tokenize_tag_content(content: &str) -> Vec<String> {
4040
current.push(ch);
4141
in_quote = None;
4242
}
43-
// Inside quote - add everything
44-
(_, Some(_)) => {
45-
current.push(ch);
46-
}
4743
// Outside quote - whitespace = delimiter
4844
(c, None) if c.is_whitespace() => {
4945
if !current.is_empty() {
5046
tokens.push(current);
5147
current = String::new();
5248
}
5349
}
54-
// Outside quote - regular char
55-
(_, None) => {
50+
// Inside quote or outside quote - regular char
51+
(_, Some(_) | None) => {
5652
current.push(ch);
5753
}
5854
}

0 commit comments

Comments
 (0)