aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive
diff options
context:
space:
mode:
authorLibravatar Yusuke Sasaki <yusuke.sasaki.nuem@gmail.com>2018-10-11 03:14:27 +0900
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-10-12 14:18:12 +0200
commit1f11e7133de188bc5a83ff4b8462c69cf1c19174 (patch)
treeea2638eb408ee3095d4639fedb15a561cbad32b9 /askama_derive
parent2e0f7fb4978297a3e82b319ea9027cf65d1a7d49 (diff)
downloadaskama-1f11e7133de188bc5a83ff4b8462c69cf1c19174.tar.gz
askama-1f11e7133de188bc5a83ff4b8462c69cf1c19174.tar.bz2
askama-1f11e7133de188bc5a83ff4b8462c69cf1c19174.zip
make `Template::extension()` static
It is useful for calculating the media type without instantiating the context value.
Diffstat (limited to 'askama_derive')
-rw-r--r--askama_derive/src/generator.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index 2c9fddb..4f83b07 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -107,7 +107,7 @@ impl<'a> Generator<'a> {
buf.writeln("Ok(())");
buf.writeln("}");
- buf.writeln("fn extension(&self) -> Option<&str> {");
+ buf.writeln("fn extension() -> Option<&'static str> {");
buf.writeln(&format!(
"{:?}",
self.input.path.extension().map(|s| s.to_str().unwrap())