diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-08 20:34:04 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-08 20:34:04 +0100 |
commit | 7b03379b7906ff952fc5253ff224101303014281 (patch) | |
tree | 4ac99229ccc25158d943c85cf515499cf00e3a7b | |
parent | a47020d4d590507defd0393782ca65cff76295da (diff) | |
download | askama-7b03379b7906ff952fc5253ff224101303014281.tar.gz askama-7b03379b7906ff952fc5253ff224101303014281.tar.bz2 askama-7b03379b7906ff952fc5253ff224101303014281.zip |
Use is_none() for simple Option tests
Diffstat (limited to '')
-rw-r--r-- | askama/src/parser.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/askama/src/parser.rs b/askama/src/parser.rs index 0b57aad..8265213 100644 --- a/askama/src/parser.rs +++ b/askama/src/parser.rs @@ -36,12 +36,12 @@ fn split_ws_parts(s: &[u8]) -> Node { *c != b' ' && *c != b'\t' && *c != b'\r' && *c != b'\n' }; let start = s.iter().position(&is_ws); - let res = if let None = start { + let res = if start.is_none() { (s, &s[0..0], &s[0..0]) } else { let start = start.unwrap(); let end = s.iter().rposition(&is_ws); - if let None = end { + if end.is_none() { (&s[..start], &s[start..], &s[0..0]) } else { let end = end.unwrap(); |