Fix code quality: trailing whitespace, unused imports, clippy warnings

- Fix trailing whitespace in kex.rs and s3.rs
- Add missing KexProposal import in kex_complete.rs
- Auto-fix clippy warnings across all crates
- All 153 tests pass
This commit is contained in:
Warren
2026-06-19 05:21:38 +08:00
parent 4b37e524cf
commit d94cb2df4c
135 changed files with 7256 additions and 4321 deletions

View File

@@ -48,10 +48,10 @@ impl FrameAlignment {
pub fn is_aligned(&self, offset: usize, size: usize) -> bool {
if self.frame_size == 0 {
return offset % self.frame_boundary == 0 && size % self.frame_boundary == 0;
return offset.is_multiple_of(self.frame_boundary) && size.is_multiple_of(self.frame_boundary);
}
offset % self.frame_size == 0 && size % self.frame_size == 0
offset.is_multiple_of(self.frame_size) && size.is_multiple_of(self.frame_size)
}
pub fn optimal_chunk_size(&self) -> usize {
@@ -74,9 +74,9 @@ impl FrameAlignment {
pub fn align_size(&self, size: usize) -> usize {
if self.frame_size == 0 {
let boundary = self.frame_boundary;
((size + boundary - 1) / boundary) * boundary
size.div_ceil(boundary) * boundary
} else {
((size + self.frame_size - 1) / self.frame_size) * self.frame_size
size.div_ceil(self.frame_size) * self.frame_size
}
}