From e2f5ff508ae0df2bc5323a6ad0e8160c03584bfe Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 8 Feb 2017 09:21:06 +0100 Subject: Fold identical branches in parser (as suggested by clippy) --- askama/src/parser.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/askama/src/parser.rs b/askama/src/parser.rs index b642b00..1e2b94e 100644 --- a/askama/src/parser.rs +++ b/askama/src/parser.rs @@ -33,9 +33,7 @@ fn take_content(i: &[u8]) -> IResult<&[u8], Node> { if *c == b'{' { if i.len() < j + 2 { return IResult::Done(&i[..0], Node::Lit(&i[..])); - } else if i[j + 1] == '{' as u8 { - return IResult::Done(&i[j..], Node::Lit(&i[..j])); - } else if i[j + 1] == '%' as u8 { + } else if i[j + 1] == b'{' || i[j + 1] == b'%' { return IResult::Done(&i[j..], Node::Lit(&i[..j])); } } -- cgit