resolve anyhow compile errors (#355)

This commit is contained in:
thedavemarshall
2025-01-06 11:13:01 -06:00
committed by GitHub
parent d955ae10a5
commit ba3a128e84
8 changed files with 23 additions and 15 deletions

View File

@@ -405,7 +405,9 @@ impl Value {
#[cfg(feature = "yaml")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub fn from_yaml_str(yaml: &str) -> Result<Value> {
Ok(serde_yaml::from_str(yaml)?)
let value = serde_yaml::from_str(yaml)
.map_err(|err| anyhow::anyhow!("Failed to parse YAML: {}", err))?;
Ok(value)
}
/// Deserialize a value from a file containing YAML.