fix: resolve all Clippy warnings across codebase - Fixed field reassignment warnings in ecstore/src/file_meta.rs by using struct initialization instead of default + field assignment - Fixed overly complex boolean expression in ecstore/src/utils/os/mod.rs by removing meaningless assertion - Replaced manual Default implementation with derive in crates/zip/src/lib.rs - Updated io::Error usage to use io::Error::other() instead of deprecated pattern - Removed useless assertions and clone-on-copy warnings - Fixed unwrap usage by replacing with expect() providing meaningful error messages - Fixed useless vec usage by using array repeat instead - All code now passes comprehensive Clippy check with --all-targets --all-features -- -D warnings

This commit is contained in:
安正超
2025-05-28 11:00:07 +08:00
parent 96d0155bcc
commit a1f4abf6c3
37 changed files with 309 additions and 255 deletions
+4 -10
View File
@@ -21,20 +21,15 @@ pub enum CompressionFormat {
Unknown,
}
#[derive(Debug, PartialEq, Clone, Copy)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum CompressionLevel {
Fastest,
Best,
#[default]
Default,
Level(u32),
}
impl Default for CompressionLevel {
fn default() -> Self {
CompressionLevel::Default
}
}
impl CompressionFormat {
/// Identify compression format from file extension
pub fn from_extension(ext: &str) -> Self {
@@ -679,7 +674,7 @@ mod tests {
async move {
if invocation_number == 0 {
// First invocation returns an error
Err(io::Error::new(io::ErrorKind::Other, "Simulated callback error"))
Err(io::Error::other("Simulated callback error"))
} else {
Ok(())
}
@@ -765,8 +760,7 @@ mod tests {
}
}
// 如果能执行到这里,说明性能是可接受的
assert!(true, "Extension parsing performance test completed");
// Extension parsing performance test completed
}
#[test]