Returns the Yaml as a `Hash` or an error if it isn't.
(value: &Yaml)
| 180 | |
| 181 | /// Returns the Yaml as a `Hash` or an error if it isn't. |
| 182 | pub fn as_hash_checked(value: &Yaml) -> Result<&Hash> { |
| 183 | let result = value.as_hash(); |
| 184 | let result = result.ok_or_else(|| yaml_type_err(value, "hashmap"))?; |
| 185 | return Ok( result ); |
| 186 | } |
| 187 | |
| 188 | /// Returns the Yaml as a `Vec` or an error if it isn't. |
| 189 | pub fn as_vec_checked(value: &Yaml) -> Result<&Vec<Yaml>> { |
no test coverage detected