Skip to content

Commit de3b3df

Browse files
mivertowskiclaude
andcommitted
fix(ci): resolve remaining CI failures
Clippy: Fix 3 unnecessary_sort_by warnings in ringkernel-core by using sort_by_key(|x| Reverse(x.field)) instead of sort_by closures. Affected: introspection.rs, scheduling.rs, memory_pressure.rs. Security Audit: Replace rustsec/audit-check@v2 with direct cargo-audit invocation. The action was failing with 'Resource not accessible by integration' due to missing checks:write permission. Our audit showed zero vulnerabilities — the failure was a permissions/integration issue, not a security issue. 1485 tests pass, 0 failures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cdfc44c commit de3b3df

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,13 @@ jobs:
9696
runs-on: ubuntu-latest
9797
steps:
9898
- uses: actions/checkout@v4
99-
- uses: rustsec/audit-check@v2
100-
with:
101-
token: ${{ secrets.GITHUB_TOKEN }}
99+
- uses: dtolnay/rust-toolchain@stable
100+
- name: Install cargo-audit
101+
run: cargo install --locked cargo-audit
102+
- name: Run cargo audit
103+
# Uses .cargo/audit.toml for ignored advisories (documented transitive deps).
104+
# Unmaintained warnings are informational and do not fail the build.
105+
run: cargo audit
102106

103107
# Feature matrix: test key feature combinations that work without GPU hardware
104108
feature-matrix:

crates/ringkernel-core/src/introspection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl TraceBuffer {
135135
/// Get recent trace entries (most recent first).
136136
pub fn recent(&self, limit: usize) -> Vec<&TraceEntry> {
137137
let mut result: Vec<&TraceEntry> = self.entries.iter().collect();
138-
result.sort_by(|a, b| b.received_at.cmp(&a.received_at));
138+
result.sort_by_key(|e| std::cmp::Reverse(e.received_at));
139139
result.truncate(limit);
140140
result
141141
}

crates/ringkernel-core/src/memory_pressure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ impl MemoryPressureMonitor {
236236
.iter()
237237
.map(|(&id, b)| (id, b.current_bytes))
238238
.collect();
239-
actors.sort_by(|a, b| b.1.cmp(&a.1));
239+
actors.sort_by_key(|a| std::cmp::Reverse(a.1));
240240
actors
241241
}
242242

crates/ringkernel-core/src/scheduling.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ impl LoadTable {
468468
.collect();
469469

470470
// Sort victims by excess load (descending)
471-
victims.sort_by(|a, b| b.1.cmp(&a.1));
471+
victims.sort_by_key(|v| std::cmp::Reverse(v.1));
472472

473473
// Match thieves to victims
474474
let mut victim_idx = 0;

0 commit comments

Comments
 (0)