From a9aebf82fbb59a0323c78c4c248eaaafab1ab00f Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Fri, 7 Jan 2022 01:06:35 +0100 Subject: Determine Content-Type during compilation --- askama_shared/src/generator.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'askama_shared/src/generator.rs') diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index 5c6303c..cd18819 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -165,6 +165,10 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> { buf.writeln(&format!("{}", size_hint))?; buf.writeln(";")?; + buf.writeln("const MIME_TYPE: &'static ::std::primitive::str = ")?; + buf.writeln(&format!("{:?}", &self.input.mime_type))?; + buf.writeln(";")?; + buf.writeln("}")?; Ok(()) } -- cgit