From 7b03379b7906ff952fc5253ff224101303014281 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 8 Feb 2017 20:34:04 +0100 Subject: Use is_none() for simple Option tests --- askama/src/parser.rs | 4 ++-- 1 file 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(); -- cgit