Parse Codex CLI config TOML into a document table
(content: &str)
| 996 | |
| 997 | /// Parse Codex CLI config TOML into a document table |
| 998 | fn parse_codex_doc(content: &str) -> Result<TomlTable> { |
| 999 | let mut parsed: TomlValue = |
| 1000 | toml::from_str(content).context("Failed to parse existing Codex config as TOML")?; |
| 1001 | if let Some(table) = parsed.as_table_mut() { |
| 1002 | Ok(std::mem::take(table)) |
| 1003 | } else { |
| 1004 | Ok(TomlTable::new()) |
| 1005 | } |
| 1006 | } |
| 1007 | |
| 1008 | /// Convert TOML value recursively to JSON value for unified parsing APIs |
| 1009 | fn toml_to_json_value(value: &TomlValue) -> Value { |
no outgoing calls
no test coverage detected