mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-10 19:48:54 +00:00
Fix some clippy warnings
This commit is contained in:
parent
7eab597b48
commit
521a4001dc
3 changed files with 4 additions and 3 deletions
|
|
@ -52,11 +52,11 @@ fn get_element_properties(element: &Element, result: &mut Vec<PropertyInformatio
|
||||||
|
|
||||||
fn insert_property_definition_range(
|
fn insert_property_definition_range(
|
||||||
property: &str,
|
property: &str,
|
||||||
properties: &mut Vec<PropertyInformation>,
|
properties: &mut [PropertyInformation],
|
||||||
range: (u32, u32),
|
range: (u32, u32),
|
||||||
) {
|
) {
|
||||||
let index = properties
|
let index = properties
|
||||||
.binary_search_by(|p| (&p.name[..]).cmp(&property))
|
.binary_search_by(|p| (p.name[..]).cmp(property))
|
||||||
.expect("property must be known");
|
.expect("property must be known");
|
||||||
properties[index].defined_at = Some(range);
|
properties[index].defined_at = Some(range);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -320,7 +320,7 @@ fn maybe_goto_preview(
|
||||||
let begin = text[..offset].rfind(|x: char| !x.is_ascii_alphanumeric())? + 1;
|
let begin = text[..offset].rfind(|x: char| !x.is_ascii_alphanumeric())? + 1;
|
||||||
let text = &text.as_bytes()[begin..];
|
let text = &text.as_bytes()[begin..];
|
||||||
let rest = text.strip_prefix(b"preview").or_else(|| text.strip_prefix(b"PREVIEW"))?;
|
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;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
mod completion;
|
mod completion;
|
||||||
mod goto;
|
mod goto;
|
||||||
mod lsp_ext;
|
mod lsp_ext;
|
||||||
|
mod properties;
|
||||||
mod semantic_tokens;
|
mod semantic_tokens;
|
||||||
mod server_loop;
|
mod server_loop;
|
||||||
mod util;
|
mod util;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue