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

Function as_str_checked

src/speech.rs:196–198  ·  view source on GitHub ↗

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

(yaml: &Yaml)

Source from the content-addressed store, hash-verified

194
195/// Returns the Yaml as a `&str` or an error if it isn't.
196pub fn as_str_checked(yaml: &Yaml) -> Result<&str> {
197 return Ok( yaml.as_str().ok_or_else(|| yaml_type_err(yaml, "string"))? );
198}
199
200
201/// A bit of a hack to concatenate replacements (without a ' ').

Callers 3

buildMethod · 0.85
add_prefsMethod · 0.85
buildMethod · 0.85

Calls 2

yaml_type_errFunction · 0.85
as_strMethod · 0.80

Tested by

no test coverage detected