Parse a YAML mapping (object) from a string. Returns None on structural failure.
(yaml: &str)
| 909 | |
| 910 | /// Parse a YAML mapping (object) from a string. Returns None on structural failure. |
| 911 | fn 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. |
no test coverage detected