forked from kent/consciousness
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:
parent
3640de444b
commit
653da40dcd
21 changed files with 99 additions and 149 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue