From 56cee872e8716bc2b697aa346f88bfe511c0c48f Mon Sep 17 00:00:00 2001 From: Jacob Wahlgren Date: Thu, 12 Oct 2017 21:50:33 +0200 Subject: [PATCH] Box Handlebars template error See https://github.com/azerupi/mdBook/pull/466#issuecomment-335450110 --- src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)) + } + } }