chore: change CodexAuth::from_api_key() to take &str instead of String (#1970)

Good practice and simplifies some of the call sites.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1970).
* #1971
* __->__ #1970
* #1966
* #1965
* #1962
This commit is contained in:
Michael Bolin
2025-08-07 16:55:33 -07:00
committed by GitHub
parent b991c04f86
commit 295abf3e51
5 changed files with 9 additions and 9 deletions

View File

@@ -52,9 +52,9 @@ impl PartialEq for CodexAuth {
}
impl CodexAuth {
pub fn from_api_key(api_key: String) -> Self {
pub fn from_api_key(api_key: &str) -> Self {
Self {
api_key: Some(api_key),
api_key: Some(api_key.to_owned()),
mode: AuthMode::ApiKey,
auth_file: PathBuf::new(),
auth_dot_json: Arc::new(Mutex::new(None)),