Skip to content

Commit 49c1e23

Browse files
clippy
1 parent bb50d73 commit 49c1e23

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/djls-server/src/completions.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,15 +347,15 @@ fn calculate_replacement_range(
347347
closing: &ClosingBrace,
348348
) -> Range {
349349
// Start position: move back by the length of the partial text
350-
let start_col = position.character.saturating_sub(partial_len as u32);
350+
let start_col = position.character.saturating_sub(u32::try_from(partial_len).unwrap_or(0));
351351
let start = Position::new(position.line, start_col);
352352

353353
// End position: include auto-paired } if present
354354
let mut end_col = position.character;
355355
if matches!(closing, ClosingBrace::PartialClose) {
356356
// Include the auto-paired } in the replacement range
357357
// Check if there's a } immediately after cursor
358-
if line_text.len() > cursor_offset && &line_text[cursor_offset..cursor_offset + 1] == "}" {
358+
if line_text.len() > cursor_offset && &line_text[cursor_offset..=cursor_offset] == "}" {
359359
end_col += 1;
360360
}
361361
}
@@ -365,6 +365,7 @@ fn calculate_replacement_range(
365365
}
366366

367367
/// Generate completions for tag names
368+
#[allow(clippy::too_many_arguments)]
368369
fn generate_tag_name_completions(
369370
partial: &str,
370371
needs_space: bool,

0 commit comments

Comments
 (0)