From 6498b2eecb21ad87069be8f501f35374745106d9 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 5 May 2022 19:28:57 +0300 Subject: refactor: drop the subplot::Result type alias Replace subplot::Result with Result. I find this now to be clearer, as I don't need to remind myself which Result is being used where. This should not be a breaking change. Sponsored-by: author --- src/metadata.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/metadata.rs') 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

(basedir: P, doc: &Pandoc, template: Option<&str>) -> Result + pub fn new

( + basedir: P, + doc: &Pandoc, + template: Option<&str>, + ) -> Result where P: AsRef + Debug, { @@ -152,7 +155,7 @@ fn get_bindings_filenames(map: &Mapp) -> Vec { get_paths("", map, "bindings") } -fn load_template_spec(template: &str) -> Result { +fn load_template_spec(template: &str) -> Result { 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

(filenames: &[P], bindings: &mut Bindings, template: Option<&str>) -> Result<()> +fn get_bindings

( + filenames: &[P], + bindings: &mut Bindings, + template: Option<&str>, +) -> Result<(), SubplotError> where P: AsRef + Debug, { -- cgit v1.2.1