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
+2 -3
View File
@@ -627,7 +627,7 @@ impl LocalDisk {
};
if let Some(dir) = data_dir {
let vid = fi.version_id.unwrap_or(Uuid::nil());
let vid = fi.version_id.unwrap_or_default();
let _ = fm.data.remove(vec![vid, dir]);
let dir_path = self.get_object_path(volume, format!("{}/{}", path, dir).as_str())?;
@@ -1194,7 +1194,6 @@ impl DiskAPI for LocalDisk {
Ok(())
}
#[must_use]
#[tracing::instrument(skip(self))]
async fn read_all(&self, volume: &str, path: &str) -> Result<Vec<u8>> {
if volume == RUSTFS_META_BUCKET && path == super::FORMAT_CONFIG_FILE {
@@ -2183,7 +2182,7 @@ impl DiskAPI for LocalDisk {
let old_dir = meta.delete_version(&fi)?;
if let Some(uuid) = old_dir {
let vid = fi.version_id.unwrap_or(Uuid::nil());
let vid = fi.version_id.unwrap_or_default();
let _ = meta.data.remove(vec![vid, uuid])?;
let old_path = file_path.join(Path::new(uuid.to_string().as_str()));
+1 -1
View File
@@ -601,7 +601,7 @@ impl FileInfoVersions {
return None;
}
let vid = Uuid::parse_str(v).unwrap_or(Uuid::nil());
let vid = Uuid::parse_str(v).unwrap_or_default();
self.versions.iter().position(|v| v.version_id == Some(vid))
}