diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-05-21 23:04:39 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-05-21 23:04:39 +0200 |
commit | b5a6a34bdd642ea2d89f984fb50f4371365c9b93 (patch) | |
tree | 20dd33ffe2e629b62e5a3db61abfa6dc2b0a7f78 | |
parent | e7c0d7ba16b561ba4377827218debcf710191aa3 (diff) | |
download | askama-b5a6a34bdd642ea2d89f984fb50f4371365c9b93.tar.gz askama-b5a6a34bdd642ea2d89f984fb50f4371365c9b93.tar.bz2 askama-b5a6a34bdd642ea2d89f984fb50f4371365c9b93.zip |
Cast empty arrays to slice to get around clippy
-rw-r--r-- | askama_shared/src/parser.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/askama_shared/src/parser.rs b/askama_shared/src/parser.rs index b7a9851..10c4ce8 100644 --- a/askama_shared/src/parser.rs +++ b/askama_shared/src/parser.rs @@ -124,7 +124,6 @@ where } } -#[allow(clippy::reversed_empty_ranges)] fn split_ws_parts(s: &[u8]) -> Node { if s.is_empty() { let rs = str::from_utf8(s).unwrap(); @@ -138,10 +137,10 @@ fn split_ws_parts(s: &[u8]) -> Node { if let Some(end) = end { (&s[..start], &s[start..=end], &s[end + 1..]) } else { - (&s[..start], &s[start..], &s[0..0]) + (&s[..start], &s[start..], &[] as &[u8]) } } else { - (s, &s[0..0], &s[0..0]) + (s, &[] as &[u8], &[] as &[u8]) }; Node::Lit( |