fix clippy

This commit is contained in:
WindSoilder 2024-06-21 08:58:05 +08:00
parent ee03e45053
commit 3718afefee

View File

@ -2834,10 +2834,10 @@ pub fn parse_string(working_set: &mut StateWorkingSet, span: Span) -> Expression
// Check for unbalanced quotes:
{
if bytes.starts_with(b"\"")
&& (bytes.into_iter().filter(|ch| **ch == b'"').count() > 1 && !bytes.ends_with(b"\""))
&& (bytes.iter().filter(|ch| **ch == b'"').count() > 1 && !bytes.ends_with(b"\""))
{
let close_delimiter_index = bytes
.into_iter()
.iter()
.skip(1)
.position(|ch| *ch == b'"')
.expect("Already check input bytes contains at least two double quotes");
@ -2848,10 +2848,10 @@ pub fn parse_string(working_set: &mut StateWorkingSet, span: Span) -> Expression
}
if bytes.starts_with(b"\'")
&& (bytes.into_iter().filter(|ch| **ch == b'\'').count() > 1 && !bytes.ends_with(b"\'"))
&& (bytes.iter().filter(|ch| **ch == b'\'').count() > 1 && !bytes.ends_with(b"\'"))
{
let close_delimiter_index = bytes
.into_iter()
.iter()
.skip(1)
.position(|ch| *ch == b'\'')
.expect("Already check input bytes contains at least two double quotes");