From 64169a3962bf447895c70b6e353385011284f672 Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Sat, 19 Oct 2024 15:15:58 +0900 Subject: [PATCH] fix: clippy warnings --- crates/py2erg/convert.rs | 4 +--- crates/pylyzer_core/analyze.rs | 2 ++ tests/test.rs | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/py2erg/convert.rs b/crates/py2erg/convert.rs index 82a4952..2bf1835 100644 --- a/crates/py2erg/convert.rs +++ b/crates/py2erg/convert.rs @@ -436,9 +436,7 @@ impl PyiTypeStorage { return; }; let mut locator = RandomLocator::new(&code); - let Ok(py_program) = locator.fold(py_program) else { - return; - }; + let Ok(py_program) = locator.fold(py_program); for stmt in py_program.body { match stmt { py_ast::Stmt::AnnAssign(assign) => { diff --git a/crates/pylyzer_core/analyze.rs b/crates/pylyzer_core/analyze.rs index 34fb2de..8f0ad17 100644 --- a/crates/pylyzer_core/analyze.rs +++ b/crates/pylyzer_core/analyze.rs @@ -224,6 +224,7 @@ impl PythonAnalyzer { New::new(cfg) } + #[allow(clippy::result_large_err)] fn check( &mut self, erg_ast: AST, @@ -256,6 +257,7 @@ impl PythonAnalyzer { } } + #[allow(clippy::result_large_err)] pub fn analyze( &mut self, py_code: String, diff --git a/tests/test.rs b/tests/test.rs index 91b5bc8..a7d690c 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -6,6 +6,7 @@ use erg_common::spawn::exec_new_thread; use erg_compiler::artifact::{CompleteArtifact, IncompleteArtifact}; use pylyzer_core::PythonAnalyzer; +#[allow(clippy::result_large_err)] pub fn exec_analyzer(file_path: &'static str) -> Result { let cfg = ErgConfig { input: Input::file(PathBuf::from(file_path)),