From 5f3e93da3f1815f24b82b026b95e748267d1b5e8 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 14 Aug 2017 12:57:01 +0200 Subject: Use error-chain to create a crate-specific Error type --- askama_derive/src/generator.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'askama_derive') diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 24d34cf..b00094d 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -481,8 +481,8 @@ impl<'a> Generator<'a> { // Implement `Display` for the given context struct. fn impl_display(&mut self, ast: &syn::DeriveInput) { self.write_header(ast, "::std::fmt::Display"); - self.writeln("fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::askama::Result<()> {"); - self.writeln("self.render_into(f)"); + self.writeln("fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {"); + self.writeln("self.render_into(f).map_err(|_| ::std::fmt::Error {})"); self.writeln("}"); self.writeln("}"); } -- cgit