xcfg/format/toml_impl.rs
1use crate::error::Error;
2
3pub fn from_str<T>(input: &str) -> Result<T, Error>
4where
5 T: serde::de::DeserializeOwned,
6{
7 toml::from_str(input).map_err(Error::from)
8}
9
10pub fn to_string<T>(input: &T) -> Result<String, Error>
11where
12 T: serde::Serialize,
13{
14 toml::to_string(input).map_err(Error::from)
15}