chore(v1.1.9): clippy clean — workspace -D warnings

Surfaced + fixed during the F3 attestation:

- executor-core/sdk/queue.rs: drop redundant .map(|()| ()) call sites;
  enqueue_blocking discards QueueMessageId via .map(|_id| ()) (intentional)
- executor-core/sdk/retry.rs: hoist use std::collections::hash_map::DefaultHasher
  + use std::hash::Hasher to the top of the file (clippy::items_after_statements);
  replace `as i64` casts with i64::try_from + clear comment about jitter
  bound (clippy::cast_possible_wrap)
- executor-core/sdk/invoke.rs: move _LIMITS_IS_COPY const before #[cfg(test)]
  mod tests (clippy::items_after_test_module)
- manager-core/dispatcher.rs: dispatch_one_queue gains #[allow(too_many_lines)]
  (it's the queue tick's whole logic — split makes it less readable than
  the lint); .map(...).unwrap_or(default) → .map_or(default, ...)
- picloud/lib.rs: Limits { trigger_depth_max, ..Limits::default() } via
  struct-update instead of let-mut-assign (clippy::field_reassign_with_default)
- tests: r#"..."# → r"..." where there are no `"` inside (clippy::needless_raw_string_hashes);
  combine InvokeTarget::Name | InvokeTarget::Path arms with identical bodies
  in sdk_invoke.rs (clippy::match_same_arms)

cargo fmt --all -- --check 2>&1 | tail -3: no output (exit 0)
cargo clippy --workspace --all-targets --all-features -- -D warnings:
  Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.41s
Workspace lib smoke: 432 passing (306 manager-core + 74 executor-core + 34 shared + 18 orchestrator-core).
DB-gated E2E (against docker compose postgres on localhost:15432):
  queue_e2e: 4 ok / invoke_e2e: 4 ok / retry_e2e: 3 ok / migration_queue_messages: 4 ok / schema_snapshot: 1 ok

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-06-07 11:02:22 +02:00
parent c38c46b8bc
commit c3baa87415
18 changed files with 197 additions and 154 deletions

View File

@@ -163,6 +163,7 @@ impl Dispatcher {
Ok(())
}
#[allow(clippy::too_many_lines)]
async fn dispatch_one_queue(
&self,
consumer: &ActiveQueueConsumer,
@@ -183,7 +184,11 @@ impl Dispatcher {
let Ok(permit) = self.gate.try_acquire() else {
let _ = self
.queue
.nack(claimed.id, claimed.claim_token, chrono::Duration::milliseconds(100))
.nack(
claimed.id,
claimed.claim_token,
chrono::Duration::milliseconds(100),
)
.await;
return Ok(());
};
@@ -299,7 +304,11 @@ impl Dispatcher {
self.config.retry_jitter_pct,
);
let delay = chrono::Duration::milliseconds(i64::from(delay_ms));
if let Err(e) = self.queue.nack(claimed.id, claimed.claim_token, delay).await {
if let Err(e) = self
.queue
.nack(claimed.id, claimed.claim_token, delay)
.await
{
tracing::warn!(?e, "queue nack failed");
}
return;
@@ -621,12 +630,14 @@ impl Dispatcher {
));
}
let args = payload.get("args").cloned().unwrap_or(serde_json::Value::Null);
let args = payload
.get("args")
.cloned()
.unwrap_or(serde_json::Value::Null);
let trigger_depth = payload
.get("trigger_depth")
.and_then(serde_json::Value::as_u64)
.map(|n| u32::try_from(n).unwrap_or(u32::MAX))
.unwrap_or(row.trigger_depth);
.map_or(row.trigger_depth, |n| u32::try_from(n).unwrap_or(u32::MAX));
let execution_id = ExecutionId::new();
let req = ExecRequest {