Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

fix(ingest): satisfy workspace Clippy gate

bugere29aa85ae32b
diff --git a/engine/crates/xerj-engine/src/index.rs b/engine/crates/xerj-engine/src/index.rs
index e256fc68e..9d72c3f99 100644
--- a/engine/crates/xerj-engine/src/index.rs
+++ b/engine/crates/xerj-engine/src/index.rs
@@ -16880,7 +16880,6 @@ impl Drop for FlushDurationTimer {
}
}
-#[allow(clippy::too_many_arguments)] // free fn threading the full flush-pipeline dependency set
#[cfg(test)]
#[derive(Clone)]
struct FlushPublisherTestHook {
@@ -16893,6 +16892,10 @@ tokio::task_local! {
static FLUSH_PUBLISHER_TEST_HOOK: FlushPublisherTestHook;
}
+// This deliberately remains a free function so background tasks can own every
+// flush dependency without retaining `Index`; grouping the values would only
+// hide the same pipeline dependency set behind an uninformative bag of fields.
+#[allow(clippy::too_many_arguments)]
async fn do_flush_shard(
shard_idx: usize,
store: Arc<IndexStore>,
diff --git a/engine/crates/xerj-engine/src/ingest_memory.rs b/engine/crates/xerj-engine/src/ingest_memory.rs
index f635d7b12..5f2a06c12 100644
--- a/engine/crates/xerj-engine/src/ingest_memory.rs
+++ b/engine/crates/xerj-engine/src/ingest_memory.rs
@@ -452,6 +452,12 @@ impl Ledger {
}
}
+impl Default for Ledger {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
pub static LEDGER: Ledger = Ledger::new();
/// Build one sampler-owned event. This is the only public event constructor:
diff --git a/engine/crates/xerj-server/src/ingest_memory_trace.rs b/engine/crates/xerj-server/src/ingest_memory_trace.rs
index a7db3d8e6..b779881c3 100644
--- a/engine/crates/xerj-server/src/ingest_memory_trace.rs
+++ b/engine/crates/xerj-server/src/ingest_memory_trace.rs
@@ -195,11 +195,8 @@ fn writer_loop(rx: mpsc::Receiver<String>, dropped: Arc<AtomicU64>) {
let output =
std::env::var("XERJ_INGEST_MEMORY_OUTPUT").unwrap_or_else(|_| "tracing".to_string());
if output == "tracing" {
- loop {
- match rx.recv() {
- Ok(line) => tracing::info!(target: "xerj::ingest_memory", "{line}"),
- Err(_) => break,
- }
+ while let Ok(line) = rx.recv() {
+ tracing::info!(target: "xerj::ingest_memory", "{line}");
}
while let Ok(line) = rx.try_recv() {
tracing::info!(target: "xerj::ingest_memory", "{line}");
@@ -219,15 +216,10 @@ fn writer_loop(rx: mpsc::Receiver<String>, dropped: Arc<AtomicU64>) {
return;
}
};
- loop {
- match rx.recv() {
- Ok(line) => {
- if let Err(error) = writeln!(file, "{line}") {
- record_sink_error(&dropped, &output, &error);
- break;
- }
- }
- Err(_) => break,
+ while let Ok(line) = rx.recv() {
+ if let Err(error) = writeln!(file, "{line}") {
+ record_sink_error(&dropped, &output, &error);
+ break;
}
}
while let Ok(line) = rx.try_recv() {