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.

fmt: cargo fmt -p xerj-common (the #1158 diff)

xerj-org86c9893d13cb
diff --git a/engine/crates/xerj-common/src/xccode/mod.rs b/engine/crates/xerj-common/src/xccode/mod.rs
index bfd967916..192b0484e 100644
--- a/engine/crates/xerj-common/src/xccode/mod.rs
+++ b/engine/crates/xerj-common/src/xccode/mod.rs
@@ -1112,9 +1112,7 @@ mod tests {
let reqs = http.searches.lock().unwrap().clone();
assert!(!reqs.is_empty());
assert_eq!(
- reqs[0]
- .1
- .pointer("/query/bool/must/0/multi_match/fields"),
+ reqs[0].1.pointer("/query/bool/must/0/multi_match/fields"),
Some(&serde_json::json!(["details", "summary"])),
"the corpus's own text fields, sorted — not the silent-zero body floor",
);
diff --git a/engine/crates/xerj-common/src/xccode/render.rs b/engine/crates/xerj-common/src/xccode/render.rs
index bc10a297f..c46b16d8d 100644
--- a/engine/crates/xerj-common/src/xccode/render.rs
+++ b/engine/crates/xerj-common/src/xccode/render.rs
@@ -46,9 +46,7 @@ fn longest_string_field(src: &Value) -> String {
keys.sort();
for key in keys {
if let Some(s) = obj[key].as_str() {
- if !s.trim().is_empty()
- && best.is_none_or(|(len, _)| s.chars().count() > len)
- {
+ if !s.trim().is_empty() && best.is_none_or(|(len, _)| s.chars().count() > len) {
best = Some((s.chars().count(), s));
}
}
@@ -345,7 +343,10 @@ mod tests {
text.contains("vulnerable to command injection"),
"the passage is `details`, the longest field: {text}"
);
- assert!(!text.contains("[0 of 0 chars"), "no empty-passage shape: {text}");
+ assert!(
+ !text.contains("[0 of 0 chars"),
+ "no empty-passage shape: {text}"
+ );
// Tie: two fields of equal length — the alphabetically first wins.
let tie = json!({