From 098e18a989e2e3a457bc02cc76244bf28b3c9605 Mon Sep 17 00:00:00 2001 From: MechaCat02 Date: Sat, 30 May 2026 19:00:35 +0200 Subject: [PATCH] chore(clippy): silence three v1.1.0-foundation lints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - sdk/bridge.rs: drop #[must_use] on the bridge fns — `Dynamic` and `serde_json::Value` are both #[must_use] already; the wrapper attribute is double-must-use noise. - api.rs IntoResponse: hoist `use ApiError as E;` above the early Overloaded branch so `E::Exec(...)` works in the if-let too (clippy::items_after_statements). - gate.rs test: bind the returned permit with `let _ =` so the OwnedSemaphorePermit doesn't trip unused-must-use. No behaviour change. Caught by `cargo clippy --all-targets --all-features -- -D warnings`. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/executor-core/src/sdk/bridge.rs | 2 -- crates/orchestrator-core/src/api.rs | 4 ++-- crates/orchestrator-core/src/gate.rs | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/executor-core/src/sdk/bridge.rs b/crates/executor-core/src/sdk/bridge.rs index 07d223d..57b6f8f 100644 --- a/crates/executor-core/src/sdk/bridge.rs +++ b/crates/executor-core/src/sdk/bridge.rs @@ -14,7 +14,6 @@ use serde_json::Value as Json; /// pushing into a script's scope. Numbers prefer the narrowest type /// (`i64` over `f64`); anything that can't round-trip falls back to a /// string so the script always sees a defined value. -#[must_use] pub fn json_to_dynamic(value: Json) -> Dynamic { match value { Json::Null => Dynamic::UNIT, @@ -48,7 +47,6 @@ pub fn json_to_dynamic(value: Json) -> Dynamic { /// types (timestamps, user-registered modules) fall back to their /// `Display` form so they appear as strings in JSON output rather than /// failing the response build. -#[must_use] pub fn dynamic_to_json(value: &Dynamic) -> Json { if value.is_unit() { return Json::Null; diff --git a/crates/orchestrator-core/src/api.rs b/crates/orchestrator-core/src/api.rs index 779b93e..a412ff5 100644 --- a/crates/orchestrator-core/src/api.rs +++ b/crates/orchestrator-core/src/api.rs @@ -424,7 +424,8 @@ impl IntoResponse for ApiError { // header (Retry-After), so it short-circuits the (status, body) // reduction below. Axum's tuple builder makes per-arm header // injection awkward otherwise. - if let ApiError::Exec(ExecError::Overloaded { retry_after_secs }) = &self { + use ApiError as E; + if let E::Exec(ExecError::Overloaded { retry_after_secs }) = &self { let retry = retry_after_secs.to_string(); let body = Json(serde_json::json!({ "error": self.to_string() })); return ( @@ -435,7 +436,6 @@ impl IntoResponse for ApiError { .into_response(); } - use ApiError as E; let (status, message) = match &self { E::NotFound(_) => (StatusCode::NOT_FOUND, self.to_string()), E::BadRequest(_) => (StatusCode::BAD_REQUEST, self.to_string()), diff --git a/crates/orchestrator-core/src/gate.rs b/crates/orchestrator-core/src/gate.rs index 5fd6ce3..ba6698e 100644 --- a/crates/orchestrator-core/src/gate.rs +++ b/crates/orchestrator-core/src/gate.rs @@ -142,7 +142,8 @@ mod tests { { let _p = gate.try_acquire().expect("first permit available"); } - gate.try_acquire() + let _ = gate + .try_acquire() .expect("slot must be returned after permit drops"); }