From e92f4648307dd1913b919b508475b40aa017e5df Mon Sep 17 00:00:00 2001 From: aibrahim-oai Date: Fri, 11 Jul 2025 12:08:56 -0700 Subject: [PATCH] Fix tests compile warnings --- codex-rs/core/src/chat_completions.rs | 5 ----- codex-rs/core/src/openai_tools.rs | 16 ++++++++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/codex-rs/core/src/chat_completions.rs b/codex-rs/core/src/chat_completions.rs index 32426aae7a..331a0892f3 100644 --- a/codex-rs/core/src/chat_completions.rs +++ b/codex-rs/core/src/chat_completions.rs @@ -467,16 +467,11 @@ impl AggregateStreamExt for T where T: Stream> + mod tests { #![allow(clippy::unwrap_used)] - use super::super::client::ModelClient; use super::*; use crate::config::{Config, ConfigOverrides, ConfigToml}; - use crate::config_types::{ - ReasoningEffort as ReasoningEffortConfig, ReasoningSummary as ReasoningSummaryConfig, - }; use crate::{ModelProviderInfo, WireApi}; use mockito::Server; use once_cell::sync::Lazy; - use reqwest; use serde_json::Value; use std::sync::Mutex; diff --git a/codex-rs/core/src/openai_tools.rs b/codex-rs/core/src/openai_tools.rs index 98110dc26a..bc3852caf7 100644 --- a/codex-rs/core/src/openai_tools.rs +++ b/codex-rs/core/src/openai_tools.rs @@ -179,9 +179,11 @@ mod tests { #[test] fn responses_api_includes_default_and_extra_tools() { - let mut prompt = Prompt::default(); - prompt.extra_tools = hashmap! { - "srv/echo".into() => sample_tool(), + let prompt = Prompt { + extra_tools: hashmap! { + "srv/echo".into() => sample_tool(), + }, + ..Default::default() }; let tools = create_tools_json_for_responses_api(&prompt, "gpt-4").unwrap(); @@ -208,9 +210,11 @@ mod tests { #[test] fn chat_api_tools_are_wrapped_correctly() { - let mut prompt = Prompt::default(); - prompt.extra_tools = hashmap! { - "srv/echo".into() => sample_tool(), + let prompt = Prompt { + extra_tools: hashmap! { + "srv/echo".into() => sample_tool(), + }, + ..Default::default() }; let tools = create_tools_json_for_chat_completions_api(&prompt, "gpt-4").unwrap();