Returns the Yaml as a `Vec` or an error if it isn't.
(value: &Yaml)
| 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>> { |
| 190 | let result = value.as_vec(); |
| 191 | let result = result.ok_or_else(|| yaml_type_err(value, "array"))?; |
| 192 | return Ok( result ); |
| 193 | } |
| 194 | |
| 195 | /// Returns the Yaml as a `&str` or an error if it isn't. |
| 196 | pub fn as_str_checked(yaml: &Yaml) -> Result<&str> { |
no test coverage detected