fix(simulation): resolve clippy warnings in atlas modules
Replace HashMap/HashSet with BTreeMap/BTreeSet per D-030 determinism rule. Fix while_let_loop, map_or simplification, collapsible if, unsigned_abs casting, iterator indexing, and redundant wildcard arms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -109,7 +109,7 @@ pub struct GenerationQueue {
|
||||
/// Rayon thread pool dedicated to generation work.
|
||||
pool: rayon::ThreadPool,
|
||||
/// Set of body_ids currently in-flight to avoid duplicate submissions.
|
||||
in_flight: Arc<Mutex<std::collections::HashSet<String>>>,
|
||||
in_flight: Arc<Mutex<std::collections::BTreeSet<String>>>,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for GenerationQueue {
|
||||
@@ -150,7 +150,7 @@ impl GenerationQueue {
|
||||
completion_tx: tx,
|
||||
completion_rx: rx,
|
||||
pool,
|
||||
in_flight: Arc::new(Mutex::new(std::collections::HashSet::new())),
|
||||
in_flight: Arc::new(Mutex::new(std::collections::BTreeSet::new())),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ impl GenerationQueue {
|
||||
// Check pending list.
|
||||
let pending = self.pending.lock().unwrap();
|
||||
if pending.iter().any(|q| {
|
||||
q.item.body_id().map_or(false, |id| id == body_id)
|
||||
q.item.body_id() == Some(body_id)
|
||||
}) {
|
||||
return;
|
||||
}
|
||||
@@ -193,11 +193,8 @@ impl GenerationQueue {
|
||||
/// available without blocking.
|
||||
pub fn drain_completions(&self) -> Vec<GenCompletion> {
|
||||
let mut out = Vec::new();
|
||||
loop {
|
||||
match self.completion_rx.try_recv() {
|
||||
Ok(c) => out.push(c),
|
||||
Err(_) => break,
|
||||
}
|
||||
while let Ok(c) = self.completion_rx.try_recv() {
|
||||
out.push(c);
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user