Function
yaml_get
(value: &'a serde_yaml::Value, key: &str)
Source from the content-addressed store, hash-verified
| 779 | } |
| 780 | |
| 781 | fn yaml_get<'a>(value: &'a serde_yaml::Value, key: &str) -> Option<&'a serde_yaml::Value> { |
| 782 | value |
| 783 | .as_mapping() |
| 784 | .and_then(|mapping| mapping.get(serde_yaml::Value::String(key.to_string()))) |
| 785 | } |
| 786 | |
| 787 | fn yaml_get_any<'a>(value: &'a serde_yaml::Value, keys: &[&str]) -> Option<&'a serde_yaml::Value> { |
| 788 | keys.iter().find_map(|key| yaml_get(value, key)) |
Tested by
no test coverage detected