From fef994d2f678a56b08f37043c306cfbf4a93427b Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 20 Oct 2017 10:11:19 +0200 Subject: Tighten up parser code for path expressions --- askama_shared/src/parser.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'askama_shared/src') diff --git a/askama_shared/src/parser.rs b/askama_shared/src/parser.rs index accefd2..eff1779 100644 --- a/askama_shared/src/parser.rs +++ b/askama_shared/src/parser.rs @@ -162,10 +162,8 @@ named!(expr_path, do_parse!( (part) )) >> ({ - let mut path = vec![ start ]; - for part in rest.iter() { - path.push(part); - } + let mut path = vec![start]; + path.extend(rest); Expr::Path(path) }) )); -- cgit