chore: adapt to latest clippy lints
This commit is contained in:
parent
51acdf9723
commit
dc64bb5395
4 changed files with 6 additions and 6 deletions
|
|
@ -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}'"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<usize> {
|
|||
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"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2478,7 +2478,7 @@ impl Query {
|
|||
_ => QueryErrorKind::Syntax,
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return Err(QueryError {
|
||||
row,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue