diff --git a/src/lib.rs b/src/lib.rs index 247d6346..cec4617d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -105,7 +105,7 @@ pub mod errors { foreign_links { Io(::std::io::Error); HandlebarsRender(::handlebars::RenderError); - HandlebarsTemplate(::handlebars::TemplateError); + HandlebarsTemplate(Box<::handlebars::TemplateError>); Utf8(::std::string::FromUtf8Error); } @@ -116,4 +116,11 @@ pub mod errors { } } } + + // Box to halve the size of Error + impl From<::handlebars::TemplateError> for Error { + fn from(e: ::handlebars::TemplateError) -> Error { + From::from(Box::new(e)) + } + } } diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index 2d8ab7fd..20323eec 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -124,6 +124,7 @@ impl HtmlHandlebars { Ok(()) } + #[cfg_attr(feature = "cargo-clippy", allow(let_and_return))] fn post_process(&self, rendered: String, filepath: &str,