use anyhow::Context; use serde::Serialize; pub fn string(str: &str) -> String { serde_yml::to_string(str).expect("Should be able to encode string") } pub fn to_string(value: &T) -> anyhow::Result { serde_yml::to_string(value).context("Could not serialize to yaml") }