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
commit 653da40dcd
21 changed files with 99 additions and 149 deletions

View file

@ -572,13 +572,11 @@ fn add_implicit_temporal_edges(
fn date_from_key(key: &str) -> Option<NaiveDate> {
// Try extracting YYYY-MM-DD after known prefixes
for prefix in ["daily-", "journal#j-", "journal#"] {
if let Some(rest) = key.strip_prefix(prefix) {
if rest.len() >= 10 {
if let Ok(d) = NaiveDate::parse_from_str(&rest[..10], "%Y-%m-%d") {
if let Some(rest) = key.strip_prefix(prefix)
&& rest.len() >= 10
&& let Ok(d) = NaiveDate::parse_from_str(&rest[..10], "%Y-%m-%d") {
return Some(d);
}
}
}
}
None
}
@ -650,9 +648,8 @@ fn add_implicit_temporal_edges(
monthlies.sort_by_key(|(_, ym)| *ym);
let add_edge = |adj: &mut HashMap<String, Vec<Edge>>, a: &str, b: &str| {
if let Some(edges) = adj.get(a) {
if edges.iter().any(|e| e.target == b) { return; }
}
if let Some(edges) = adj.get(a)
&& edges.iter().any(|e| e.target == b) { return; }
adj.entry(a.to_owned()).or_default().push(Edge {
target: b.to_owned(),
strength: 1.0,