aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-05-27 10:30:53 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-05-27 10:30:53 +0200
commit6fa83bf79f76f2d3ab40d32498f684b55889e2ff (patch)
tree6936bbfa35e76e8ecbfcee78dcc07f32d6500c78
parentac4aaf6503f7e13641cbdd8fba2c4a10b81b1f97 (diff)
downloadaskama-6fa83bf79f76f2d3ab40d32498f684b55889e2ff.tar.gz
askama-6fa83bf79f76f2d3ab40d32498f684b55889e2ff.tar.bz2
askama-6fa83bf79f76f2d3ab40d32498f684b55889e2ff.zip
Simplify code according to clippy suggestions
Diffstat (limited to '')
-rw-r--r--askama_derive/src/generator.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index d309abd..5a01d7b 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -56,11 +56,8 @@ impl<'a> State<'a> {
while check_nested < blocks.len() {
if let Node::BlockDef(_, _, ref nodes, _) = blocks[check_nested] {
for n in nodes {
- match n {
- def @ Node::BlockDef(_, _, _, _) => {
- nested_blocks.push(def);
- },
- _ => {},
+ if let def @ Node::BlockDef(_, _, _, _) = n {
+ nested_blocks.push(def);
}
}
} else {
@@ -793,7 +790,7 @@ impl<'a> Generator<'a> {
fn visit_method_call(&mut self, obj: &Expr, method: &str, args: &[Expr], code: &mut String)
-> DisplayWrap {
- if let &Expr::Var("self") = obj {
+ if let Expr::Var("self") = obj {
code.push_str("self");
} else {
self.visit_expr(obj, code);