From 20774355eaf71809ef34e394dd677222652f1634 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Sun, 3 May 2026 00:20:36 +0300 Subject: [PATCH] Move app-server tier id conversion out of type --- codex-rs/app-server-protocol/src/protocol/v2.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/codex-rs/app-server-protocol/src/protocol/v2.rs b/codex-rs/app-server-protocol/src/protocol/v2.rs index 9cdf56a185..1e521ebcb9 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2.rs @@ -160,10 +160,8 @@ impl TryFrom<&CoreServiceTier> for ServiceTier { #[ts(type = "string", export_to = "v2/")] pub struct ServiceTierId(pub String); -impl ServiceTierId { - pub fn into_core(self) -> CoreServiceTier { - CoreServiceTier::new(self.0) - } +pub fn service_tier_id_into_core(service_tier_id: ServiceTierId) -> CoreServiceTier { + CoreServiceTier::from(service_tier_id.0) } impl From for ServiceTierId { @@ -2588,7 +2586,7 @@ impl From for ModelServiceTier { impl From for CoreModelServiceTier { fn from(value: ModelServiceTier) -> Self { Self { - id: value.id.into_core(), + id: service_tier_id_into_core(value.id), name: value.name, description: value.description, }