add pedantic clippy setting and fix/allow warnings (#147)
Some checks are pending
lint / pre-commit (push) Waiting to run
lint / rustfmt (push) Waiting to run
lint / clippy (push) Waiting to run
lint / cargo-check (push) Waiting to run
release / build (push) Waiting to run
release / test (push) Waiting to run
release / release (push) Blocked by required conditions
test / generate-matrix (push) Waiting to run
test / Python , Django () (push) Blocked by required conditions
test / tests (push) Blocked by required conditions
zizmor 🌈 / zizmor latest via PyPI (push) Waiting to run

This commit is contained in:
Josh Thomas 2025-05-14 18:21:43 -05:00 committed by GitHub
parent e87c917cb6
commit d677aacf7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 180 additions and 113 deletions

View file

@ -104,7 +104,7 @@ impl Store {
#[allow(dead_code)]
pub fn is_version_valid(&self, uri: &str, version: i32) -> bool {
self.get_version(uri).map_or(false, |v| v == version)
self.get_version(uri) == Some(version)
}
pub fn get_completions(
@ -240,9 +240,10 @@ impl TextDocument {
}
pub fn get_template_tag_context(&self, position: Position) -> Option<TemplateTagContext> {
let line = self.get_line(position.line.try_into().ok()?)?;
let prefix = &line[..position.character.try_into().ok()?];
let rest_of_line = &line[position.character.try_into().ok()?..];
let line = self.get_line(position.line)?;
let char_pos: usize = position.character.try_into().ok()?;
let prefix = &line[..char_pos];
let rest_of_line = &line[char_pos..];
let rest_trimmed = rest_of_line.trim_start();
prefix.rfind("{%").map(|tag_start| {