From 0cfbd08892f73849208e7eff5490ece41c0c4527 Mon Sep 17 00:00:00 2001 From: Glyphack Date: Mon, 30 Oct 2023 19:44:36 +0100 Subject: [PATCH] Cargo clippy fix --- parser/src/parser/parser.rs | 2 +- typechecker/src/build.rs | 2 +- typechecker/src/state.rs | 2 +- typechecker/src/symbol_table.rs | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/parser/src/parser/parser.rs b/parser/src/parser/parser.rs index 3b3a4f88..787921f3 100644 --- a/parser/src/parser/parser.rs +++ b/parser/src/parser/parser.rs @@ -3131,7 +3131,7 @@ impl Parser { self.expect(Kind::Comma)?; } } - if type_params.len() == 0 { + if type_params.is_empty() { return Err(self.unexpected_token_new( node, vec![Kind::Identifier, Kind::Pow, Kind::Mul], diff --git a/typechecker/src/build.rs b/typechecker/src/build.rs index af97ce36..d210b3fa 100644 --- a/typechecker/src/build.rs +++ b/typechecker/src/build.rs @@ -180,7 +180,7 @@ impl BuildManager { let mut new_imports = vec![]; let mut discovered_files = vec![]; for state in current_files { - let resolved_imports = self.resolve_file_imports(&state); + let resolved_imports = self.resolve_file_imports(state); // check if the resolved_imports are not in the current files and add them to the new imports for (_, state) in resolved_imports { if !self.modules.contains_key(&state.file.module_name()) { diff --git a/typechecker/src/state.rs b/typechecker/src/state.rs index b34b99f7..120bc34d 100644 --- a/typechecker/src/state.rs +++ b/typechecker/src/state.rs @@ -7,7 +7,7 @@ use crate::{ ruff_python_import_resolver as ruff_python_resolver, ruff_python_import_resolver::resolver, ruff_python_import_resolver::{ - self, import_result::ImportResult, module_descriptor::ImportModuleDescriptor, + import_result::ImportResult, module_descriptor::ImportModuleDescriptor, }, semantic_analyzer::SemanticAnalyzer, symbol_table::SymbolTable, diff --git a/typechecker/src/symbol_table.rs b/typechecker/src/symbol_table.rs index 70971f15..09dd96fe 100644 --- a/typechecker/src/symbol_table.rs +++ b/typechecker/src/symbol_table.rs @@ -2,9 +2,8 @@ use enderpy_python_parser::ast::{self, Node}; use std::{collections::HashMap, fmt::Display}; use crate::{ - nodes::ImportKinds, ruff_python_import_resolver::{ - import_result::ImportResult, module_descriptor::ImportModuleDescriptor, + import_result::ImportResult, }, };