summaryrefslogtreecommitdiff
path: root/src/metadata.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/metadata.rs')
-rw-r--r--src/metadata.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/metadata.rs b/src/metadata.rs
index 0248891..5f5e183 100644
--- a/src/metadata.rs
+++ b/src/metadata.rs
@@ -1,5 +1,4 @@
-use crate::Result;
-use crate::{Bindings, TemplateSpec};
+use crate::{Bindings, SubplotError, TemplateSpec};
use std::collections::HashMap;
use std::fmt::Debug;
@@ -31,7 +30,11 @@ pub struct DocumentImpl {
impl Metadata {
/// Construct a Metadata from a Document, if possible.
- pub fn new<P>(basedir: P, doc: &Pandoc, template: Option<&str>) -> Result<Metadata>
+ pub fn new<P>(
+ basedir: P,
+ doc: &Pandoc,
+ template: Option<&str>,
+ ) -> Result<Metadata, SubplotError>
where
P: AsRef<Path> + Debug,
{
@@ -152,7 +155,7 @@ fn get_bindings_filenames(map: &Mapp) -> Vec<PathBuf> {
get_paths("", map, "bindings")
}
-fn load_template_spec(template: &str) -> Result<TemplateSpec> {
+fn load_template_spec(template: &str) -> Result<TemplateSpec, SubplotError> {
let mut spec_path = PathBuf::from(template);
spec_path.push("template");
spec_path.push("template.yaml");
@@ -298,7 +301,11 @@ mod test_join {
}
}
-fn get_bindings<P>(filenames: &[P], bindings: &mut Bindings, template: Option<&str>) -> Result<()>
+fn get_bindings<P>(
+ filenames: &[P],
+ bindings: &mut Bindings,
+ template: Option<&str>,
+) -> Result<(), SubplotError>
where
P: AsRef<Path> + Debug,
{