Skip to content

fix: clippy unnecessary_sort_by in cognitive_memory blocking PR #889 CI (unblocks #890) #893

Description

@rysweet

Context

PR #889 (research idea extractor) merged but the verify workflow is failing on cargo clippy --all-targets --all-features --locked -- -D warnings due to clippy::unnecessary_sort_by lints introduced/exposed by the merge. This blocks validation issue #890 which gates the end-to-end smoke of the idea extractor and therefore blocks closure of goal explore-developer-ideas-from-tracked-researchers.

Failing locations

From CI log of run 24597973906 and local grep:

  • src/cognitive_memory/mod.rs:316candidates.sort_by(|a, b| b.0.cmp(&a.0));
  • src/cognitive_memory/mod.rs:549backups.sort_by(|a, b| b.0.cmp(&a.0));
  • src/knowledge_context.rs:63scored.sort_by(|a, b| b.0.cmp(&a.0));

(Verify with full clippy run; there may be more.)

Fix

Replace each with sort_by_key + Reverse per clippy hint:

use std::cmp::Reverse;
candidates.sort_by_key(|x| Reverse(x.0));

Acceptance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions