From de43af154382fbba2a8c263e6b82a9092255f72b Mon Sep 17 00:00:00 2001 From: Aleksey Yakovlev Date: Wed, 10 Jul 2024 15:08:00 +0700 Subject: [PATCH] clippy run --- src/cli/mod.rs | 4 ++-- src/compiler/cst/parser.rs | 2 ++ src/compiler/{compiler.rs => hexo_compiler.rs} | 0 src/compiler/mod.rs | 4 ++-- src/util/logger.rs | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) rename src/compiler/{compiler.rs => hexo_compiler.rs} (100%) diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 70db149..ea87b49 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -144,7 +144,7 @@ impl Cli { impl ValueEnum for LogLevel { fn value_variants<'a>() -> &'a [Self] { - return &[Self::Debug, Self::Info, Self::Warn, Self::Error, Self::None] + &[Self::Debug, Self::Info, Self::Warn, Self::Error, Self::None] } fn to_possible_value(&self) -> Option { @@ -156,7 +156,7 @@ impl ValueEnum for LogLevel { LogLevel::None => { "none" } }; - return Some( + Some( PossibleValue::new(name) ) } diff --git a/src/compiler/cst/parser.rs b/src/compiler/cst/parser.rs index 6a715cf..e72d6d4 100644 --- a/src/compiler/cst/parser.rs +++ b/src/compiler/cst/parser.rs @@ -7,12 +7,14 @@ use crate::compiler::cst::{ CstActualParameter, CstAtom, CstConstantStatement, CstEmitStatement, CstFunctionStatement, }; use crate::match_ast; +use crate::util::logger; #[derive(Default)] pub(crate) struct CstParser {} impl CstParser { pub(crate) fn parse(&self, path: &Path, ast_root: AstNode) -> Result { + logger::debug!("Parsing CST of {:?}", path); parse_file(path, &ast_root) } } diff --git a/src/compiler/compiler.rs b/src/compiler/hexo_compiler.rs similarity index 100% rename from src/compiler/compiler.rs rename to src/compiler/hexo_compiler.rs diff --git a/src/compiler/mod.rs b/src/compiler/mod.rs index 8fb413a..a4c3493 100644 --- a/src/compiler/mod.rs +++ b/src/compiler/mod.rs @@ -1,5 +1,5 @@ mod compilation_result; -mod compiler; +mod hexo_compiler; mod compiler_context; mod compiler_source; mod error; @@ -9,7 +9,7 @@ mod cst; mod ast; pub(crate) use compilation_result::Compilation; -pub(crate) use compiler::HexoCompiler; +pub(crate) use hexo_compiler::HexoCompiler; pub(crate) use compiler_context::HexoCompilerContext; pub(crate) use compiler_source::{CompilerSource, FileCompilerSource}; pub(crate) use error::Error; diff --git a/src/util/logger.rs b/src/util/logger.rs index 0131737..657d212 100644 --- a/src/util/logger.rs +++ b/src/util/logger.rs @@ -41,7 +41,7 @@ pub(crate) struct HexoLogger { impl HexoLogger { pub(crate) fn level(&self) -> &LogLevel { - return &self.level; + &self.level } pub(crate) fn set_level(level: LogLevel) {