mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
Clippy again
This commit is contained in:
@@ -48,7 +48,7 @@ async fn init_backend(user_agent_suffix: &str) -> anyhow::Result<BackendContext>
|
||||
});
|
||||
}
|
||||
|
||||
let ua = codex_core::default_client::get_codex_user_agent();
|
||||
let ua = codex_core::client::http::get_codex_user_agent();
|
||||
let mut http = codex_cloud_tasks_client::HttpClient::new(base_url.clone())?.with_user_agent(ua);
|
||||
let style = if base_url.contains("/backend-api") {
|
||||
"wham"
|
||||
@@ -384,7 +384,7 @@ pub async fn run_main(cli: Cli, _codex_linux_sandbox_exe: Option<PathBuf>) -> an
|
||||
append_error_log(format!(
|
||||
"startup: wham_force_internal={} ua={}",
|
||||
force_internal,
|
||||
codex_core::default_client::get_codex_user_agent()
|
||||
codex_core::client::http::get_codex_user_agent()
|
||||
));
|
||||
// Non-blocking initial load so the in-box spinner can animate
|
||||
app.status = "Loading tasks…".to_string();
|
||||
|
||||
@@ -7,7 +7,7 @@ use codex_core::config::ConfigOverrides;
|
||||
use codex_login::AuthManager;
|
||||
|
||||
pub fn set_user_agent_suffix(suffix: &str) {
|
||||
if let Ok(mut guard) = codex_core::default_client::USER_AGENT_SUFFIX.lock() {
|
||||
if let Ok(mut guard) = codex_core::client::http::USER_AGENT_SUFFIX.lock() {
|
||||
guard.replace(suffix.to_string());
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ pub async fn build_chatgpt_headers() -> HeaderMap {
|
||||
use reqwest::header::USER_AGENT;
|
||||
|
||||
set_user_agent_suffix("codex_cloud_tasks_tui");
|
||||
let ua = codex_core::default_client::get_codex_user_agent();
|
||||
let ua = codex_core::client::http::get_codex_user_agent();
|
||||
let mut headers = HeaderMap::new();
|
||||
headers.insert(
|
||||
USER_AGENT,
|
||||
|
||||
@@ -1114,10 +1114,11 @@ mod tests {
|
||||
provider: ModelProviderInfo,
|
||||
otel_event_manager: OtelEventManager,
|
||||
) -> Vec<Result<ResponseEvent>> {
|
||||
#[allow(clippy::needless_collect)] // Avoid useless lifetime specifiers.
|
||||
let owned_chunks: Vec<Vec<u8>> = chunks.iter().map(|chunk| (*chunk).to_vec()).collect();
|
||||
|
||||
let stream = futures::stream::iter(
|
||||
chunks
|
||||
.iter()
|
||||
.map(|chunk| (*chunk).to_vec())
|
||||
owned_chunks
|
||||
.into_iter()
|
||||
.map(|bytes| Ok::<Bytes, CodexErr>(Bytes::from(bytes))),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user