aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared/src/generator.rs
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-09-04 20:31:28 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-09-04 20:31:28 +0200
commit23279c3bce4b0b21504f20e76b5cdfa783d4394c (patch)
treea7536a1be234afe707384dad99c62fed3061cd11 /askama_shared/src/generator.rs
parent32a9dd5f2edf3cd288a25d11479ca32336ba4a30 (diff)
downloadaskama-23279c3bce4b0b21504f20e76b5cdfa783d4394c.tar.gz
askama-23279c3bce4b0b21504f20e76b5cdfa783d4394c.tar.bz2
askama-23279c3bce4b0b21504f20e76b5cdfa783d4394c.zip
Move filter list closer to the actual filters, add docs
Diffstat (limited to '')
-rw-r--r--askama_shared/src/generator.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs
index 4d101a1..5c4b7f8 100644
--- a/askama_shared/src/generator.rs
+++ b/askama_shared/src/generator.rs
@@ -1,3 +1,4 @@
+use filters;
use parser::{self, Cond, Expr, Node, Target, WS};
use path;
@@ -262,7 +263,7 @@ impl<'a> Generator<'a> {
return;
}
- if BUILT_IN_FILTERS.contains(&name) {
+ if filters::BUILT_IN_FILTERS.contains(&name) {
self.write(&format!("::askama::filters::{}(&", name));
} else {
self.write(&format!("filters::{}(&", name));
@@ -729,15 +730,3 @@ impl<'a, T: 'a> SetChain<'a, T> where T: cmp::Eq + hash::Hash {
}
type MacroMap<'a> = HashMap<&'a str, (WS, &'a str, Vec<&'a str>, Vec<Node<'a>>, WS)>;
-
-const BUILT_IN_FILTERS: [&str; 9] = [
- "e",
- "escape",
- "format",
- "lower",
- "lowercase",
- "trim",
- "upper",
- "uppercase",
- "json", // Optional feature; reserve the name anyway
-];