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 -4
View File
@@ -343,7 +343,7 @@ mod tests {
#[test]
fn test_error_downcast() {
// 测试错误的向下转型
let io_error = io::Error::new(io::ErrorKind::Other, "test error");
let io_error = io::Error::other("test error");
let converted: Error = io_error.into();
// 验证可以获取源错误
@@ -358,7 +358,7 @@ mod tests {
#[test]
fn test_error_chain_depth() {
// 测试错误链的深度
let root_cause = io::Error::new(io::ErrorKind::Other, "root cause");
let root_cause = io::Error::other("root cause");
let converted: Error = root_cause.into();
let mut depth = 0;
@@ -411,8 +411,8 @@ mod tests {
// Debug 输出通常包含更多信息,但不是绝对的
// 这里我们只验证两者都有内容即可
assert!(debug_str.len() > 0);
assert!(display_str.len() > 0);
assert!(!debug_str.is_empty());
assert!(!display_str.is_empty());
}
}
}