pub fn get_string_content_or_keyed_value(
    yaml: &StrictYaml,
    key: Option<&str>
) -> Result<String, DotfilesError>
Expand description

Gets the content of this YAML node or the value for a specific key in it.

If the StrictYaml node passed is a String node then it returns its contents, if the StrictYaml node is a Hash then it returns the string content of the value corresponding to the optional Key.

§Errors

  • yaml is neither a String nor a Hash
  • yaml is a hash but it does not contain a value for key
  • yaml is a hash but the value for key is not a String.