fix(ci): satisfy protocol utility clippy checks

This commit is contained in:
elky
2026-09-05 02:37:41 +08:00
parent 0097ea89ad
commit b37b252b14
2 changed files with 5 additions and 2 deletions
@@ -22,7 +22,10 @@ pub(crate) fn is_safe_openai_image_base64_payload(value: &str) -> bool {
let first_padding = bytes.iter().position(|byte| *byte == b'=');
if let Some(index) = first_padding {
let padding = bytes.len() - index;
if padding > 2 || bytes[index..].iter().any(|byte| *byte != b'=') || bytes.len() % 4 != 0 {
if padding > 2
|| bytes[index..].iter().any(|byte| *byte != b'=')
|| !bytes.len().is_multiple_of(4)
{
return false;
}
}
+1 -1
View File
@@ -42,7 +42,7 @@ fn collect_resolved_addresses_with_limit(
resolved: &mut impl Iterator<Item = SocketAddr>,
) -> io::Result<Vec<SocketAddr>> {
let mut addresses = Vec::with_capacity(MAX_DNS_RESOLVED_ADDRESSES.min(8));
while let Some(address) = resolved.next() {
for address in resolved.by_ref() {
if addresses.len() >= MAX_DNS_RESOLVED_ADDRESSES {
return Err(io::Error::new(
io::ErrorKind::InvalidData,