lint: clippy rules or_fun_call (#2561)

Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
Tunglies
2026-04-15 19:48:39 -07:00
committed by GitHub
parent 1ffe23e10f
commit 579b124726
32 changed files with 109 additions and 85 deletions
+1 -1
View File
@@ -429,7 +429,7 @@ impl FileInfo {
if self.deleted {
return "delete-marker".to_string();
}
self.data_dir.map_or("".to_string(), |dir| dir.to_string())
self.data_dir.map_or_else(|| "".to_string(), |dir| dir.to_string())
}
/// Read quorum returns expected read quorum for this FileInfo
+14 -10
View File
@@ -517,16 +517,20 @@ impl FileMetaVersion {
}
}
}
VersionType::Object => self
.object
.as_ref()
.unwrap_or(&MetaObject::default())
.into_fileinfo(volume, path, all_parts),
VersionType::Delete => self
.delete_marker
.as_ref()
.unwrap_or(&MetaDeleteMarker::default())
.into_fileinfo(volume, path, all_parts),
VersionType::Object => {
let default_object = MetaObject::default();
self.object
.as_ref()
.unwrap_or(&default_object)
.into_fileinfo(volume, path, all_parts)
}
VersionType::Delete => {
let default_marker = MetaDeleteMarker::default();
self.delete_marker
.as_ref()
.unwrap_or(&default_marker)
.into_fileinfo(volume, path, all_parts)
}
};
fi.uses_legacy_checksum = self.uses_legacy_checksum;
fi