Skip to content

Commit ef0a5e8

Browse files
committed
fix: feature-gate ai_matches to eliminate unused assignment warning
Fixed compiler warning "value assigned to ai_matches is never read" by properly feature-gating both the declaration and accumulation of ai_matches to match its usage in the logging block. The variable was: - Declared unconditionally at line 988 - Accumulated unconditionally at line 1109 - Used only inside #[cfg(feature = "ai-enhanced")] at line 1193 Fix: Added #[cfg(feature = "ai-enhanced")] to both declaration and accumulation so the variable only exists when the feature is enabled. This eliminates the warning without changing behavior.
1 parent 5f9808c commit ef0a5e8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/codegraph-mcp/src/indexer.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ impl ProjectIndexer {
985985
let mut unresolved_edges = 0;
986986
let mut exact_matches = 0;
987987
let mut pattern_matches = 0;
988+
#[cfg(feature = "ai-enhanced")]
988989
let mut ai_matches = 0;
989990
let resolution_start = std::time::Instant::now();
990991

@@ -1106,7 +1107,10 @@ impl ProjectIndexer {
11061107
for (chunk_edges, (exact, pattern, ai, unresolved)) in chunk_results {
11071108
exact_matches += exact;
11081109
pattern_matches += pattern;
1109-
ai_matches += ai;
1110+
#[cfg(feature = "ai-enhanced")]
1111+
{
1112+
ai_matches += ai;
1113+
}
11101114
unresolved_edges += unresolved;
11111115
all_resolved_edges.extend(chunk_edges);
11121116
}

0 commit comments

Comments
 (0)