chore: misc clippy lints
This commit is contained in:
parent
50bea73ce3
commit
5c6445edea
22 changed files with 74 additions and 72 deletions
|
|
@ -68,7 +68,7 @@ impl PathsJSON {
|
|||
}
|
||||
}
|
||||
|
||||
fn is_empty(&self) -> bool {
|
||||
const fn is_empty(&self) -> bool {
|
||||
matches!(self, Self::Empty)
|
||||
}
|
||||
}
|
||||
|
|
@ -141,6 +141,7 @@ pub struct TreeSitterJSON {
|
|||
}
|
||||
|
||||
impl TreeSitterJSON {
|
||||
#[must_use]
|
||||
pub fn from_file(path: &Path) -> Option<Self> {
|
||||
if let Ok(file) = fs::File::open(path.join("tree-sitter.json")) {
|
||||
Some(serde_json::from_reader(file).ok()?)
|
||||
|
|
@ -149,6 +150,7 @@ impl TreeSitterJSON {
|
|||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn has_multiple_language_configs(&self) -> bool {
|
||||
self.grammars.len() > 1
|
||||
}
|
||||
|
|
@ -366,7 +368,6 @@ impl<'a> CompileConfig<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for Loader {}
|
||||
unsafe impl Sync for Loader {}
|
||||
|
||||
impl Loader {
|
||||
|
|
@ -1004,7 +1005,7 @@ impl Loader {
|
|||
let mut command = match source {
|
||||
EmccSource::Docker => Command::new("docker"),
|
||||
EmccSource::Podman => Command::new("podman"),
|
||||
_ => unreachable!(),
|
||||
EmccSource::Native => unreachable!(),
|
||||
};
|
||||
command.args(["run", "--rm"]);
|
||||
|
||||
|
|
@ -1344,7 +1345,7 @@ impl Loader {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> LanguageConfiguration<'a> {
|
||||
impl LanguageConfiguration<'_> {
|
||||
#[cfg(feature = "tree-sitter-highlight")]
|
||||
pub fn highlight_config(
|
||||
&self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue