mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-09 04:30:20 +08:00
fix(ci): satisfy protocol utility clippy checks
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user