diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-05-06 09:30:27 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-05-06 09:34:28 +0300 |
commit | f42f4b2c27af2041436d681e4e292e549985066c (patch) | |
tree | 3f689eaee73afa054ccb86de9c5544c8263f97c1 /src/templatespec.rs | |
parent | 2a452b2d2f4fba6f840e2ea33123002ae58e88b2 (diff) | |
download | subplot-f42f4b2c27af2041436d681e4e292e549985066c.tar.gz |
refactor: replace SubplotError::YamlError with more specific one
SubplotError::YamlError is quite generic. We only parse YAML as part
of document metadata, so replace the error with a more specific one.
Sponsored-by: author
Diffstat (limited to 'src/templatespec.rs')
-rw-r--r-- | src/templatespec.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/templatespec.rs b/src/templatespec.rs index 7b8723b..28ab7e1 100644 --- a/src/templatespec.rs +++ b/src/templatespec.rs @@ -21,7 +21,7 @@ pub struct TemplateSpec { impl TemplateSpec { // Create a new TemplateSpec from YAML text. fn from_yaml(yaml: &str) -> Result<TemplateSpec, SubplotError> { - Ok(serde_yaml::from_str(yaml)?) + serde_yaml::from_str(yaml).map_err(SubplotError::Metadata) } // Create a new TemplateSpec. |