Refactor: Fix clippy warnings and introduce AppError
This commit is contained in:
1 parent
3add6c3d31
commit
4e1a633dbd
13 files changed
+129
-103
No files matched your search
@@ -22,7 +22,7 @@ pub async fn start_background_indexer(state: Arc<MemoryState>) {
|
||||
for result in walker {
|
||||
match result {
|
||||
Ok(entry) => {
|
||||
if entry.file_type().map_or(false, |ft| ft.is_file()) {
|
||||
if entry.file_type().is_some_and(|ft| ft.is_file()) {
|
||||
let path = entry.path().to_path_buf();
|
||||
let ext = path.extension().and_then(|e| e.to_str()).unwrap_or("");
|
||||
if ["rs", "ts", "js", "jsx", "tsx", "py", "java", "c", "cpp", "go"].contains(&ext) {
|
||||
@@ -98,7 +98,7 @@ pub async fn start_background_indexer(state: Arc<MemoryState>) {
|
||||
});
|
||||
}
|
||||
|
||||
fn extract_chunks(node: Node, code: &str, chunks: &mut Vec<(String, String, String)>, ext: &str) {
|
||||
fn extract_chunks(node: Node, code: &str, chunks: &mut Vec<(String, String, String)>, _ext: &str) {
|
||||
let kind = node.kind();
|
||||
let is_structural = matches!(
|
||||
kind,
|
||||
@@ -128,7 +128,7 @@ fn extract_chunks(node: Node, code: &str, chunks: &mut Vec<(String, String, Stri
|
||||
} else {
|
||||
let mut cursor = node.walk();
|
||||
for child in node.named_children(&mut cursor) {
|
||||
extract_chunks(child, code, chunks, ext);
|
||||
extract_chunks(child, code, chunks, _ext);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user