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

@@ -94,9 +94,8 @@ impl InvokeServiceImpl {
// most route-resolution invokes target write endpoints; a more
// exact API would surface method via the SDK in a future bump.
let app_routes = self.routes.snapshot_for_app(cx.app_id);
let m = matcher::r#match(&app_routes, "invoke.local", "POST", path).or_else(|| {
matcher::r#match(&app_routes, "invoke.local", "GET", path)
});
let m = matcher::r#match(&app_routes, "invoke.local", "POST", path)
.or_else(|| matcher::r#match(&app_routes, "invoke.local", "GET", path));
let m = m.ok_or_else(|| InvokeError::NotFound(format!("path {path:?}")))?;
// Resolve the script the matched route bound. Cross-app
// re-check via the script row (defense in depth — RouteTable
@@ -175,10 +174,7 @@ mod tests {
}
#[async_trait]
impl ScriptRepository for OneScriptRepo {
async fn get(
&self,
id: ScriptId,
) -> Result<Option<Script>, ScriptRepositoryError> {
async fn get(&self, id: ScriptId) -> Result<Option<Script>, ScriptRepositoryError> {
Ok(if id == self.script.id {
Some(self.script.clone())
} else {
@@ -190,19 +186,18 @@ mod tests {
app_id: AppId,
name: &str,
) -> Result<Option<Script>, ScriptRepositoryError> {
Ok(if app_id == self.script.app_id && name == self.script.name {
Some(self.script.clone())
} else {
None
})
Ok(
if app_id == self.script.app_id && name == self.script.name {
Some(self.script.clone())
} else {
None
},
)
}
async fn list(&self) -> Result<Vec<Script>, ScriptRepositoryError> {
Ok(vec![self.script.clone()])
}
async fn list_for_app(
&self,
_app_id: AppId,
) -> Result<Vec<Script>, ScriptRepositoryError> {
async fn list_for_app(&self, _app_id: AppId) -> Result<Vec<Script>, ScriptRepositoryError> {
unimplemented!()
}
async fn list_for_user(
@@ -331,7 +326,9 @@ mod tests {
let app_b = AppId::new();
let script = make_script(app_a, "worker");
let svc = InvokeServiceImpl::new(
Arc::new(OneScriptRepo { script: script.clone() }),
Arc::new(OneScriptRepo {
script: script.clone(),
}),
Arc::new(RouteTable::new()),
Arc::new(CapturingOutbox {
last: tokio::sync::Mutex::new(None),
@@ -339,7 +336,10 @@ mod tests {
);
// Caller is in app_b but the script belongs to app_a.
let cx = anon_cx(app_b);
let err = svc.resolve(&cx, InvokeTarget::Id(script.id)).await.unwrap_err();
let err = svc
.resolve(&cx, InvokeTarget::Id(script.id))
.await
.unwrap_err();
assert!(matches!(err, InvokeError::CrossApp));
}
@@ -348,7 +348,9 @@ mod tests {
let app_id = AppId::new();
let script = make_script(app_id, "worker");
let svc = InvokeServiceImpl::new(
Arc::new(OneScriptRepo { script: script.clone() }),
Arc::new(OneScriptRepo {
script: script.clone(),
}),
Arc::new(RouteTable::new()),
Arc::new(CapturingOutbox {
last: tokio::sync::Mutex::new(None),
@@ -389,7 +391,9 @@ mod tests {
last: tokio::sync::Mutex::new(None),
});
let svc = InvokeServiceImpl::new(
Arc::new(OneScriptRepo { script: script.clone() }),
Arc::new(OneScriptRepo {
script: script.clone(),
}),
Arc::new(RouteTable::new()),
outbox.clone(),
);