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

@ -384,11 +384,10 @@ impl Stage {
}
// Try algorithm parse first (bare words, no colon)
if !s.contains(':') {
if let Ok(algo) = AlgoStage::parse(s) {
if !s.contains(':')
&& let Ok(algo) = AlgoStage::parse(s) {
return Ok(Stage::Algorithm(algo));
}
}
// Algorithm with params: "spread,max_hops=4" (contains comma but no colon)
if s.contains(',') && !s.contains(':') {
@ -748,11 +747,10 @@ pub fn run_transform(
value += 1;
}
for (nbr, _) in graph.neighbors(k) {
if input_keys.contains(nbr.as_str()) {
if cover_count.get(nbr.as_str()).copied().unwrap_or(0) < REQUIRED_COVERAGE {
if input_keys.contains(nbr.as_str())
&& cover_count.get(nbr.as_str()).copied().unwrap_or(0) < REQUIRED_COVERAGE {
value += 1;
}
}
}
(k.clone(), value)
})
@ -814,7 +812,7 @@ pub fn match_seeds_opts(
key_map.insert(lkey.clone(), (key.to_owned(), weight as f64));
// Split key on hyphens, underscores, dots, hashes for component matching
for component in lkey.split(|c: char| c == '-' || c == '_' || c == '.' || c == '#') {
for component in lkey.split(['-', '_', '.', '#']) {
if component.len() >= 3 {
component_map.entry(component.to_owned())
.or_default()
@ -833,8 +831,8 @@ pub fn match_seeds_opts(
}
// Strategy 2: key component match (0.5× weight) — only when explicitly requested
if component_match {
if let Some(matches) = component_map.get(term.as_str()) {
if component_match
&& let Some(matches) = component_map.get(term.as_str()) {
for (orig_key, node_weight) in matches {
let score = term_weight * node_weight * 0.5;
*seed_map.entry(orig_key.clone()).or_insert(0.0) += score;
@ -842,7 +840,6 @@ pub fn match_seeds_opts(
}
continue;
}
}
// Strategy 3: content match (0.2× weight) — only when explicitly requested
if content_fallback {