aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama_derive/src/generator.rs2
-rw-r--r--askama_derive/src/parser.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index 07c87bf..c8e6c4d 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -983,7 +983,7 @@ impl<'a> Heritage<'a> {
while let Some(ref path) = ctx.extends {
ctx = &contexts[&path];
for (name, def) in &ctx.blocks {
- blocks.entry(name).or_insert(vec![]).push((ctx, def));
+ blocks.entry(name).or_insert_with(|| vec![]).push((ctx, def));
}
}
diff --git a/askama_derive/src/parser.rs b/askama_derive/src/parser.rs
index 5694d4e..184dc8d 100644
--- a/askama_derive/src/parser.rs
+++ b/askama_derive/src/parser.rs
@@ -429,7 +429,7 @@ named!(range_right<Input, Expr>, do_parse!(
ws!(tag_s!("..")) >>
incl: opt!(ws!(tag_s!("="))) >>
right: opt!(expr_or) >>
- (Expr::Range(if incl.is_some() { "..=" } else { ".." }, None, right.map(|v| Box::new(v))))
+ (Expr::Range(if incl.is_some() { "..=" } else { ".." }, None, right.map(Box::new)))
));
named!(expr_any<Input, Expr>, alt!(