1 unstable release
0.2.7 | Aug 25, 2024 |
---|
#880 in Configuration
15KB
310 lines
Pipelight files crate
Crate from pipelight an automation cli.
File error reports
lib.rs
:
File - parse file types with pretty diagnostics.
Well structured parsing error reports with the language specific error types. thanks to the thiserror and miette crate.
Let say you want to deserialize to a Config struct.
let res = serde_yaml::from_str::<Value>(&string);
match res {
Ok(res) => {
// do things
},
Err(e) => {
let err = YamlError::new(e, &string);
return Err(err.into());
}
};
let res = toml::from_str::<Value>(&string);
match res {
Ok(res) => {
// do things
},
Err(e) => {
let err = TomlError::new(e, &string);
return Err(err.into());
}
};
Dependencies
~20–33MB
~524K SLoC