From 935d9239276847b8dfafd5ecc419481fd40b7982 Mon Sep 17 00:00:00 2001 From: Fini Date: Sun, 24 May 2026 19:03:10 +0800 Subject: [PATCH] style(smoke): apply rustfmt to op-smoke main.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex stop-time review caught: op-smoke was not rustfmt-clean. Three hunks — outer `let model = ...unwrap_or_else` had its match body inlined; one `eprintln!` line exceeded 100 chars and needed expansion; one other formatting nit. The previous commit's `cargo fmt --all -- --check` invocation reported FMT_OK because the output scrolled past the diff hunks before I saw them — the exit code path Codex relies on (not the truncated grep output I read) caught the residual diffs. Lesson for the runbook: trust the exit code, not eyeballing tail output. `cargo fmt --all -- --check` clean now; `cargo clippy --workspace --all-targets -- -D warnings` clean. --- crates/op-smoke/src/main.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/crates/op-smoke/src/main.rs b/crates/op-smoke/src/main.rs index eb70f909a..c4225f7a0 100644 --- a/crates/op-smoke/src/main.rs +++ b/crates/op-smoke/src/main.rs @@ -217,9 +217,11 @@ async fn main() -> std::process::ExitCode { let provider_kind = std::env::var("OPENPENCIL_LLM_PROVIDER").unwrap_or_else(|_| "anthropic".into()); - let model = std::env::var("OPENPENCIL_ORCHESTRATOR_MODEL").unwrap_or_else(|_| match provider_kind.as_str() { - "anthropic" => "claude-sonnet-4-6".into(), - _ => "gpt-4o-mini".into(), + let model = std::env::var("OPENPENCIL_ORCHESTRATOR_MODEL").unwrap_or_else(|_| { + match provider_kind.as_str() { + "anthropic" => "claude-sonnet-4-6".into(), + _ => "gpt-4o-mini".into(), + } }); eprintln!("[SMOKE] provider={provider_kind} model={model}"); @@ -251,7 +253,9 @@ async fn main() -> std::process::ExitCode { .ok() .filter(|u| !u.is_empty()); let Some(base_url) = base_url else { - eprintln!("error: OPENPENCIL_LLM_BASE_URL is not set (e.g. https://api.openai.com/v1)"); + eprintln!( + "error: OPENPENCIL_LLM_BASE_URL is not set (e.g. https://api.openai.com/v1)" + ); return std::process::ExitCode::from(3); }; eprintln!("[SMOKE] base_url={base_url}"); @@ -260,7 +264,9 @@ async fn main() -> std::process::ExitCode { ))) } other => { - eprintln!("error: unknown OPENPENCIL_LLM_PROVIDER={other:?} (want anthropic|openai-compat)"); + eprintln!( + "error: unknown OPENPENCIL_LLM_PROVIDER={other:?} (want anthropic|openai-compat)" + ); return std::process::ExitCode::from(3); } };