fix(agent): simplify offline archive entry types

This commit is contained in:
t8y2
2026-07-21 14:39:51 +08:00
parent 177545dca8
commit 01b5f31740
+3 -1
View File
@@ -1250,7 +1250,9 @@ pub struct OfflineImportPlan {
pub includes_jre: bool,
}
type OfflineJreEntry = (String, String);
type OfflineDriverEntry = (String, String, bool);
type OfflineArchiveEntries = (Vec<OfflineJreEntry>, Vec<OfflineDriverEntry>);
pub fn inspect_offline_zip(zip_path: &Path) -> Result<OfflineImportPlan, String> {
let file = std::fs::File::open(zip_path).map_err(|e| format!("Failed to open ZIP file: {e}"))?;
@@ -1401,7 +1403,7 @@ pub fn import_offline_zip(
fn collect_offline_entries(
archive: &mut zip::ZipArchive<std::fs::File>,
registry: &AgentRegistry,
) -> Result<(Vec<(String, String)>, Vec<OfflineDriverEntry>), String> {
) -> Result<OfflineArchiveEntries, String> {
let platform = AgentManager::current_platform();
let mut jre_entries = Vec::new();
let mut drivers = std::collections::BTreeMap::<String, (String, bool)>::new();