chore: satisfy clippy::nonminimal_bool and prettier to unblock CI

- codex_config: rewrite `!(A && !B)` as `!A || B` (De Morgan-
  equivalent) — also reads more directly as "no OAuth, or
  already has provider API key".
- UsageScriptModal: reflow conditional onto one line per prettier.
This commit is contained in:
Jason
2026-05-25 21:53:27 +08:00
parent b15d9dfa11
commit d8a4292091
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -505,7 +505,7 @@ pub fn should_restore_codex_provider_token_for_backfill(
let has_provider_api_key = extract_codex_auth_api_key(auth).is_some();
let has_oauth_login = codex_auth_has_oauth_login_material(auth);
!(has_oauth_login && !has_provider_api_key)
!has_oauth_login || has_provider_api_key
}
fn parse_codex_positive_u64(value: Option<&Value>) -> Option<u64> {
+1 -2
View File
@@ -177,8 +177,7 @@ const UsageScriptModal: React.FC<UsageScriptModalProps> = ({
const auth = (config as any).auth || {};
const configToml = (config as any).config || "";
const apiKey =
typeof auth.OPENAI_API_KEY === "string" &&
auth.OPENAI_API_KEY.trim()
typeof auth.OPENAI_API_KEY === "string" && auth.OPENAI_API_KEY.trim()
? auth.OPENAI_API_KEY
: extractCodexExperimentalBearerToken(configToml);
return {