From 7c3629947773ccdf8e64c75ec1796e80d16ff65d Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Sat, 25 Feb 2023 16:41:42 +0100 Subject: [PATCH] fix(sdk): Fix bundle names in archive file index --- crates/dtmt/src/mods/archive.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/dtmt/src/mods/archive.rs b/crates/dtmt/src/mods/archive.rs index 2947640..37fec19 100644 --- a/crates/dtmt/src/mods/archive.rs +++ b/crates/dtmt/src/mods/archive.rs @@ -5,6 +5,7 @@ use std::path::{Path, PathBuf}; use color_eyre::eyre::{self, Context}; use color_eyre::Result; +use sdk::murmur::IdString64; use sdk::Bundle; use zip::ZipWriter; @@ -61,7 +62,10 @@ impl Archive { let mut file_map = HashMap::new(); for bundle in self.bundles.iter() { - let bundle_name = bundle.name().clone(); + let bundle_name = match bundle.name() { + IdString64::Hash(_) => eyre::bail!("bundle name must be known as string. got hash"), + IdString64::String(s) => s, + }; let map_entry: &mut HashSet<_> = file_map.entry(bundle_name).or_default();