From fed62a365c1bcd402eca5e6d29285603c5211bb2 Mon Sep 17 00:00:00 2001 From: Owen Lin Date: Sun, 2 Nov 2025 16:47:36 -0800 Subject: [PATCH] fix export.rs --- codex-rs/app-server-protocol/src/export.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/codex-rs/app-server-protocol/src/export.rs b/codex-rs/app-server-protocol/src/export.rs index 90978c31d2..ab70df79bd 100644 --- a/codex-rs/app-server-protocol/src/export.rs +++ b/codex-rs/app-server-protocol/src/export.rs @@ -195,8 +195,9 @@ pub fn generate_json(out_dir: &Path) -> Result<()> { definitions .entry(ns.to_string()) .or_insert_with(|| Value::Object(Map::new())); - if let Value::Object(defs_ns) = - definitions.get_mut(ns).expect("just inserted v2 namespace") + if let Value::Object(defs_ns) = definitions + .get_mut(ns) + .ok_or_else(|| anyhow!("just inserted v2 namespace"))? { defs_ns.insert(def_name, def_schema); } @@ -212,8 +213,9 @@ pub fn generate_json(out_dir: &Path) -> Result<()> { definitions .entry(ns.to_string()) .or_insert_with(|| Value::Object(Map::new())); - if let Value::Object(defs_ns) = - definitions.get_mut(ns).expect("just inserted v2 namespace") + if let Value::Object(defs_ns) = definitions + .get_mut(ns) + .ok_or_else(|| anyhow!("just inserted v2 namespace"))? { defs_ns.insert(logical_name.to_string(), schema_value); }