aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama_derive/src/generator.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index f2bb88a..a90fb40 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -6,18 +6,6 @@ use std::collections::HashSet;
use syn;
use quote::{Tokens, ToTokens};
-fn path_as_identifier(s: &str) -> String {
- let mut res = String::new();
- for c in s.chars() {
- if c.is_alphanumeric() {
- res.push(c);
- } else {
- res.push_str(&format!("{:x}", c as u32));
- }
- }
- res
-}
-
struct Generator<'a> {
buf: String,
indent: u8,
@@ -451,6 +439,18 @@ impl<'a> Generator<'a> {
}
+fn path_as_identifier(s: &str) -> String {
+ let mut res = String::new();
+ for c in s.chars() {
+ if c.is_alphanumeric() {
+ res.push(c);
+ } else {
+ res.push_str(&format!("{:x}", c as u32));
+ }
+ }
+ res
+}
+
pub fn generate(ast: &syn::DeriveInput, path: &str, mut nodes: Vec<Node>) -> String {
let mut base: Option<Expr> = None;
let mut blocks = Vec::new();