collaspe if block

This commit is contained in:
Edward Shen 2021-02-27 19:07:50 -05:00
parent 60f95a0358
commit 267c53f15d
Signed by: edward
GPG key ID: 19182661E818369F
2 changed files with 3 additions and 5 deletions

View file

@ -16,7 +16,7 @@ serde = ["serde_crate"]
[dependencies]
bstr = "0.2.15"
nom = { version = "6", default_features = false, features = ["std"] }
serde_crate = { version = "1", package = "serde", optional = true}
serde_crate = { version = "1", package = "serde", optional = true }
[dev-dependencies]
serde_derive = "1.0"

View file

@ -59,11 +59,9 @@ pub fn normalize(input: &[u8]) -> Cow<'_, [u8]> {
return Cow::Borrowed(&[]);
}
if size >= 3 {
if input[0] == b'=' && input[size - 1] == b'=' && input[size - 2] != b'\\' {
if size >= 3 && input[0] == b'=' && input[size - 1] == b'=' && input[size - 2] != b'\\' {
return normalize(&input[1..size]);
}
}
let mut owned = vec![];