mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-15 20:05:13 +02:00
Add error handling with NyxError and refactor console output formatting
- Introduced `NyxError` and `NyxResult` for unified error handling across modules. - Refactored `scan.rs`, `index.rs`, and `walk.rs` with improved error management and consistent formatting. - Replaced existing error handling in `database.rs` with `NyxResult`. - Improved database maintenance by integrating `vacuum` and `clear` methods into workflows. - Added `dashmap` for efficient parallel diagnostics result aggregation in `scan_with_index_parallel`. - Enhanced readability and formatting of console outputs in multiple modules.
This commit is contained in:
parent
75a20eaa2a
commit
0a66a0ae2d
14 changed files with 360 additions and 240 deletions
15
src/utils/ext.rs
Normal file
15
src/utils/ext.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
pub fn lowercase_ext(path: &std::path::Path) -> Option<&'static str> {
|
||||
path.extension()
|
||||
.and_then(|s| match s.to_str()? {
|
||||
"rs" | "RS" => Some("rs"),
|
||||
"c" => Some("c"),
|
||||
"cpp" | "c++" => Some("cpp"),
|
||||
"java" => Some("java"),
|
||||
"go" => Some("go"),
|
||||
"php" => Some("php"),
|
||||
"py" | "PY" => Some("py"),
|
||||
"ts" | "TSX" | "tsx" => Some("ts"),
|
||||
"js" => Some("js"),
|
||||
_ => None,
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue