From e1497adb506ac1d7fa8d063b4474a5519d0c10d0 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sat, 6 Oct 2018 14:19:12 +0200 Subject: Handle syntax validation during Config instantiation --- askama_derive/src/input.rs | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'askama_derive/src') diff --git a/askama_derive/src/input.rs b/askama_derive/src/input.rs index 5d3fa76..95d0019 100644 --- a/askama_derive/src/input.rs +++ b/askama_derive/src/input.rs @@ -141,26 +141,6 @@ impl<'a> TemplateInput<'a> { }, ); - if syntax.block_start.len() != 2 - || syntax.block_end.len() != 2 - || syntax.expr_start.len() != 2 - || syntax.expr_end.len() != 2 - || syntax.comment_start.len() != 2 - || syntax.comment_end.len() != 2 - { - panic!("length of delimiters must be two") - } - - let bs = syntax.block_start.as_bytes()[0]; - let be = syntax.block_start.as_bytes()[1]; - let cs = syntax.comment_start.as_bytes()[0]; - let ce = syntax.comment_start.as_bytes()[1]; - let es = syntax.block_start.as_bytes()[0]; - let ee = syntax.block_start.as_bytes()[1]; - if !(bs == cs && bs == es) && !(be == ce && be == ee) { - panic!("bad delimiters block_start: {}, comment_start: {}, expr_start: {}, needs one of the two characters in common", syntax.block_start, syntax.comment_start, syntax.expr_start); - } - TemplateInput { ast, config, -- cgit