mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-30 00:47:13 +00:00
lint: clippy rules or_fun_call (#2561)
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user