Fix some clippy warnings

This commit is contained in:
Tobias Hunger 2022-08-08 17:25:31 +02:00 committed by Tobias Hunger
parent 7eab597b48
commit 521a4001dc
3 changed files with 4 additions and 3 deletions

View file

@ -52,11 +52,11 @@ fn get_element_properties(element: &Element, result: &mut Vec<PropertyInformatio
fn insert_property_definition_range(
property: &str,
properties: &mut Vec<PropertyInformation>,
properties: &mut [PropertyInformation],
range: (u32, u32),
) {
let index = properties
.binary_search_by(|p| (&p.name[..]).cmp(&property))
.binary_search_by(|p| (p.name[..]).cmp(property))
.expect("property must be known");
properties[index].defined_at = Some(range);
}

View file

@ -320,7 +320,7 @@ fn maybe_goto_preview(
let begin = text[..offset].rfind(|x: char| !x.is_ascii_alphanumeric())? + 1;
let text = &text.as_bytes()[begin..];
let rest = text.strip_prefix(b"preview").or_else(|| text.strip_prefix(b"PREVIEW"))?;
if rest.get(0).map_or(true, |x| x.is_ascii_alphanumeric()) {
if rest.first().map_or(true, |x| x.is_ascii_alphanumeric()) {
return None;
}

View file

@ -6,6 +6,7 @@
mod completion;
mod goto;
mod lsp_ext;
mod properties;
mod semantic_tokens;
mod server_loop;
mod util;