diff --git a/cli/src/main.rs b/cli/src/main.rs index 28a169f1..bf0c562c 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1340,7 +1340,7 @@ impl Highlight { if let Some((lang, lang_config)) = loader.language_configuration_for_scope(scope)? { language = Some(lang); language_configuration = Some(lang_config); - }; + } if language.is_none() { return Err(anyhow!("Unknown scope '{scope}'")); } @@ -1494,7 +1494,7 @@ impl Tags { if let Some((lang, lang_config)) = loader.language_configuration_for_scope(scope)? { language = Some(lang); language_configuration = Some(lang_config); - }; + } if language.is_none() { return Err(anyhow!("Unknown scope '{scope}'")); } diff --git a/cli/src/parse.rs b/cli/src/parse.rs index c5302c85..91956c69 100644 --- a/cli/src/parse.rs +++ b/cli/src/parse.rs @@ -279,7 +279,7 @@ pub fn parse_file_at_path( if opts.debug == ParseDebugType::Normal { if log_type == LogType::Lex { write!(&mut io::stderr(), " ").unwrap(); - }; + } writeln!(&mut io::stderr(), "{message}").unwrap(); } else { let colors = &[ @@ -1069,7 +1069,7 @@ pub fn offset_for_position(input: &[u8], position: Point) -> Result { if let Some(pos) = iter.next() { if (pos - offset < position.column) || (input[offset] == b'\n' && position.column > 0) { return Err(anyhow!("Failed to address a column: {}", position.column)); - }; + } } else if input.len() - offset < position.column { return Err(anyhow!("Failed to address a column over the end")); } diff --git a/cli/src/tests/parser_test.rs b/cli/src/tests/parser_test.rs index 1fda8fd8..0fde31a5 100644 --- a/cli/src/tests/parser_test.rs +++ b/cli/src/tests/parser_test.rs @@ -2033,5 +2033,5 @@ const fn simple_range(start: usize, end: usize) -> Range { } fn chunked_input<'a>(text: &'a str, size: usize) -> impl FnMut(usize, Point) -> &'a [u8] { - move |offset, _| text[offset..text.len().min(offset + size)].as_bytes() + move |offset, _| &text.as_bytes()[offset..text.len().min(offset + size)] } diff --git a/lib/binding_rust/lib.rs b/lib/binding_rust/lib.rs index 8c905a6d..d04681fd 100644 --- a/lib/binding_rust/lib.rs +++ b/lib/binding_rust/lib.rs @@ -2478,7 +2478,7 @@ impl Query { _ => QueryErrorKind::Syntax, }; } - }; + } return Err(QueryError { row,