aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-08 09:21:06 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-08 09:21:11 +0100
commite2f5ff508ae0df2bc5323a6ad0e8160c03584bfe (patch)
treedcfe9b3e4489f6cd4d5a2776b3e060eade6b0d47
parent723567ba0c8d28a292b87d6d65cb97e4b4406e4b (diff)
downloadaskama-e2f5ff508ae0df2bc5323a6ad0e8160c03584bfe.tar.gz
askama-e2f5ff508ae0df2bc5323a6ad0e8160c03584bfe.tar.bz2
askama-e2f5ff508ae0df2bc5323a6ad0e8160c03584bfe.zip
Fold identical branches in parser (as suggested by clippy)
-rw-r--r--askama/src/parser.rs4
1 files changed, 1 insertions, 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]));
}
}