aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared/src/generator.rs
diff options
context:
space:
mode:
authorLibravatar René Kijewski <kijewski@library.vetmed.fu-berlin.de>2022-01-07 01:06:35 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2022-01-07 13:18:03 +0100
commita9aebf82fbb59a0323c78c4c248eaaafab1ab00f (patch)
tree696ce06be753e35efe9d814c14ec42c4b0f8f829 /askama_shared/src/generator.rs
parente7fb11ecb9278b946fffd7e6c9f82c29e5b62c94 (diff)
downloadaskama-a9aebf82fbb59a0323c78c4c248eaaafab1ab00f.tar.gz
askama-a9aebf82fbb59a0323c78c4c248eaaafab1ab00f.tar.bz2
askama-a9aebf82fbb59a0323c78c4c248eaaafab1ab00f.zip
Determine Content-Type during compilation
Diffstat (limited to '')
-rw-r--r--askama_shared/src/generator.rs4
1 files changed, 4 insertions, 0 deletions
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(())
}