refactor: NamespaceLock (nslock), AHM→Heal Crate, and Lock/Clippy Fixes (#1664)

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: weisd <2057561+weisd@users.noreply.github.com>
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
weisd
2026-01-30 13:13:41 +08:00
committed by GitHub
parent 1c085590ca
commit dce117840c
80 changed files with 3787 additions and 16746 deletions
+4 -8
View File
@@ -617,7 +617,7 @@ impl FileMeta {
// delete_version deletes version, returns data_dir
#[tracing::instrument(skip(self))]
pub fn delete_version(&mut self, fi: &FileInfo) -> Result<Option<Uuid>> {
let vid = fi.version_id.or(Some(Uuid::nil()));
let vid = Some(fi.version_id.unwrap_or(Uuid::nil()));
let mut ventry = FileMetaVersion::default();
if fi.deleted {
@@ -1725,13 +1725,9 @@ impl From<FileMetaVersion> for FileMetaVersionHeader {
f
};
let (ec_n, ec_m) = if value.version_type == VersionType::Object {
value
.object
.as_ref()
.map_or((0, 0), |o| (o.erasure_n as u8, o.erasure_m as u8))
} else {
(0, 0)
let (ec_n, ec_m) = match (value.version_type == VersionType::Object, value.object.as_ref()) {
(true, Some(obj)) => (obj.erasure_n as u8, obj.erasure_m as u8),
_ => (0, 0),
};
Self {