cleanup: auto-fix clippy warnings in poc-memory

Applied cargo clippy --fix for collapsible_if, manual_char_comparison,
and other auto-fixable warnings.
This commit is contained in:
Kent Overstreet 2026-03-21 19:42:38 -04:00
parent 3640de444b
commit 653da40dcd
21 changed files with 99 additions and 149 deletions

View file

@ -56,15 +56,14 @@ pub fn cmd_search(terms: &[String], pipeline_args: &[String], expand: bool, full
for (i, (key, score)) in raw.iter().enumerate().take(max_results) {
let weight = store.nodes.get(key).map(|n| n.weight).unwrap_or(0.0);
println!("{:2}. [{:.2}/{:.2}] {}", i + 1, score, weight, key);
if full {
if let Some(node) = store.nodes.get(key) {
if full
&& let Some(node) = store.nodes.get(key) {
println!();
for line in node.content.lines() {
println!(" {}", line);
}
println!();
}
}
}
} else {
// Fast MmapView path — algorithm-only pipeline
@ -120,15 +119,14 @@ pub fn cmd_search(terms: &[String], pipeline_args: &[String], expand: bool, full
let marker = if r.is_direct { "" } else { " " };
let weight = view.node_weight(&r.key);
println!("{}{:2}. [{:.2}/{:.2}] {}", marker, i + 1, r.activation, weight, r.key);
if full {
if let Some(content) = view.node_content(&r.key) {
if full
&& let Some(content) = view.node_content(&r.key) {
println!();
for line in content.lines() {
println!(" {}", line);
}
println!();
}
}
}
}
@ -219,11 +217,10 @@ fn get_group_content(group: &crate::config::ContextGroup, store: &crate::store::
if n.created_at > 0 { return n.created_at; }
if let Some(caps) = key_date_re.captures(&n.key) {
use chrono::{NaiveDate, TimeZone, Local};
if let Ok(d) = NaiveDate::parse_from_str(&caps[1], "%Y-%m-%d") {
if let Some(dt) = Local.from_local_datetime(&d.and_hms_opt(0, 0, 0).unwrap()).earliest() {
if let Ok(d) = NaiveDate::parse_from_str(&caps[1], "%Y-%m-%d")
&& let Some(dt) = Local.from_local_datetime(&d.and_hms_opt(0, 0, 0).unwrap()).earliest() {
return dt.timestamp();
}
}
}
n.timestamp
};