MCPcopy Create free account
hub / github.com/daisy/MathCAT / as_hash_checked

Function as_hash_checked

src/speech.rs:182–186  ·  view source on GitHub ↗

Returns the Yaml as a `Hash` or an error if it isn't.

(value: &Yaml)

Source from the content-addressed store, hash-verified

180
181/// Returns the Yaml as a `Hash` or an error if it isn't.
182pub 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.
189pub fn as_vec_checked(value: &Yaml) -> Result<&Vec<Yaml>> {

Callers 1

build_valuesFunction · 0.85

Calls 1

yaml_type_errFunction · 0.85

Tested by

no test coverage detected