diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-08 09:21:06 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-08 09:21:11 +0100 |
commit | e2f5ff508ae0df2bc5323a6ad0e8160c03584bfe (patch) | |
tree | dcfe9b3e4489f6cd4d5a2776b3e060eade6b0d47 | |
parent | 723567ba0c8d28a292b87d6d65cb97e4b4406e4b (diff) | |
download | askama-e2f5ff508ae0df2bc5323a6ad0e8160c03584bfe.tar.gz askama-e2f5ff508ae0df2bc5323a6ad0e8160c03584bfe.tar.bz2 askama-e2f5ff508ae0df2bc5323a6ad0e8160c03584bfe.zip |
Fold identical branches in parser (as suggested by clippy)
Diffstat (limited to '')
-rw-r--r-- | askama/src/parser.rs | 4 |
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])); } } |