Skip to content

Commit

Permalink
fix(s3s): clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Nugine committed Feb 1, 2025
1 parent 1f93200 commit fadfecc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/s3s/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn parse_host_header<'a>(base_domain: &'a str, host: &'a str) -> Option<VirtualH

if let Some(bucket) = host.strip_suffix(base_domain).and_then(|h| h.strip_suffix('.')) {
return Some(VirtualHost::with_bucket(base_domain, bucket));
};
}

None
}
Expand Down
2 changes: 1 addition & 1 deletion crates/s3s/src/http/aws_chunked_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl AwsChunkedStream {
None => break,
Some(Err(e)) => return Err(AwsChunkedStreamError::Underlying(e)),
Some(Ok(remaining_bytes)) => prev_bytes = remaining_bytes,
};
}
if let Ok((_, meta)) = parse_chunk_meta(&buf) {
meta
} else {
Expand Down
10 changes: 5 additions & 5 deletions crates/s3s/src/http/multipart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ where
None => return Err(MultipartError::InvalidFormat),
Some(Err(e)) => return Err(MultipartError::Underlying(e)),
Some(Ok(bytes)) => buf.extend_from_slice(&bytes),
};
}

// try to parse
match try_parse(body, pat, &buf, &mut fields, boundary) {
Expand Down Expand Up @@ -139,7 +139,7 @@ where
Some(line) => {
if line != pat_without_crlf {
return Ok(Err(MultipartError::InvalidFormat));
};
}
}
}
}
Expand All @@ -148,7 +148,7 @@ where
return Ok(Err(MultipartError::InvalidFormat));
}
}
};
}

let mut headers = [httparse::EMPTY_HEADER; 2];
loop {
Expand Down Expand Up @@ -280,7 +280,7 @@ impl FileStream {
None => return Err(FileStreamError::Incomplete),
Some(Err(e)) => return Err(FileStreamError::Underlying(e)),
Some(Ok(b)) => bytes = b,
};
}
state = 2;
continue 'dfa;
}
Expand Down Expand Up @@ -318,7 +318,7 @@ impl FileStream {
None => return Err(FileStreamError::Incomplete),
Some(Err(e)) => return Err(FileStreamError::Underlying(e)),
Some(Ok(b)) => buf.extend_from_slice(&b),
};
}
bytes = Bytes::from(mem::take(&mut buf));
state = 2;
continue 'dfa;
Expand Down

0 comments on commit fadfecc

Please sign in to comment.