MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / parse_yaml_mapping

Function parse_yaml_mapping

crates/opencode-config/src/loader.rs:911–915  ·  view source on GitHub ↗

Parse a YAML mapping (object) from a string. Returns None on structural failure.

(yaml: &str)

Source from the content-addressed store, hash-verified

909
910/// Parse a YAML mapping (object) from a string. Returns None on structural failure.
911fn parse_yaml_mapping(yaml: &str) -> Option<serde_json::Value> {
912 let lines: Vec<&str> = yaml.lines().collect();
913 let (map, _) = parse_yaml_mapping_lines(&lines, 0, 0)?;
914 Some(serde_json::Value::Object(map))
915}
916
917/// Parse YAML mapping lines starting at `start` index with expected `base_indent`.
918/// Returns the parsed map and the index of the next unconsumed line.

Callers 1

Calls 1

parse_yaml_mapping_linesFunction · 0.85

Tested by

no test coverage detected