mirror of
https://github.com/Momoko-Ayase/Senbei.git
synced 2026-11-03 18:31:28 -05:00
fix(android): adjust the parsing of construction tables
This commit is contained in:
1 parent
ba1dacc0b2
commit
366a19c2a1
5 files changed
+822
-158
No files matched your search
@@ -16,6 +16,7 @@ fn wanted_id(command_id: u32) -> bool {
|
||||
pub(crate) struct Artifact {
|
||||
pub path: PathBuf,
|
||||
pub size: u64,
|
||||
pub entry_offset: Option<u32>,
|
||||
}
|
||||
|
||||
pub(crate) fn load_artifacts(index_path: &Path) -> Result<BTreeMap<u32, Artifact>> {
|
||||
@@ -47,6 +48,10 @@ pub(crate) fn load_artifacts(index_path: &Path) -> Result<BTreeMap<u32, Artifact
|
||||
Artifact {
|
||||
path: root.join(path),
|
||||
size,
|
||||
entry_offset: item
|
||||
.get("entry_offset")
|
||||
.and_then(Value::as_u64)
|
||||
.and_then(|value| u32::try_from(value).ok()),
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -79,6 +84,10 @@ pub(crate) fn load_artifacts(index_path: &Path) -> Result<BTreeMap<u32, Artifact
|
||||
Artifact {
|
||||
path: root.join(path),
|
||||
size,
|
||||
entry_offset: record
|
||||
.get("entry_offset")
|
||||
.and_then(Value::as_u64)
|
||||
.and_then(|value| u32::try_from(value).ok()),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user