diff --git a/Cargo.lock b/Cargo.lock index cf89d0f1d..4e56ccd07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1029,9 +1029,9 @@ dependencies = [ [[package]] name = "craft-figcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=46bc8d7a0#46bc8d7a0ac906b59ce0c94b074367fd98d84d84" +source = "git+https://github.com/storytold/craft-libs?rev=c1d198925#c1d198925f10a640c4623cf9c1c0f775ff2d972e" dependencies = [ - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=46bc8d7a0)", + "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c1d198925)", "serde", "serde_json", "thiserror 2.0.21", @@ -1231,7 +1231,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=46bc8d7a0#46bc8d7a0ac906b59ce0c94b074367fd98d84d84" +source = "git+https://github.com/storytold/craft-libs?rev=c1d198925#c1d198925f10a640c4623cf9c1c0f775ff2d972e" dependencies = [ "flate2", "thiserror 2.0.21", diff --git a/Cargo.toml b/Cargo.toml index 04b3fe6b9..1e51bcecd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,7 +60,7 @@ craft-settings = { git = "https://github.com/storytold/craft-libs", rev = "e11f9 # a .fig message onto the REST file JSON, and that JSON's shared helpers. These crates share # types, so they stay on one rev; they share none with the crates above. craft-fig = { git = "https://github.com/storytold/craft-libs", rev = "d13ac58a15c45d618f25910772502e38c4ce1d4c" } -craft-figcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "46bc8d7a0" } +craft-figcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "c1d198925" } craft-figma-rest = { git = "https://github.com/storytold/craft-libs", rev = "d13ac58a15c45d618f25910772502e38c4ce1d4c" } # foundation diff --git a/crates/format/src/lib.rs b/crates/format/src/lib.rs index 90a24ce64..011ffff74 100644 --- a/crates/format/src/lib.rs +++ b/crates/format/src/lib.rs @@ -503,7 +503,7 @@ pub fn save_bytes_with_history( &mut z, BRANCH_INDEX, craft_figcraft_format::Compression::Level(3), - &serde_json::to_vec(&NativeBranchIndex { branches: index }).map_err(io_err)?, + &craft_figcraft_format::write_branch_index(&NativeBranchIndex { branches: index }).map_err(io_err)?, )?; } if let Some(lib) = &doc.published { @@ -542,7 +542,7 @@ fn put_versions(z: &mut craft_figcraft_format::ArchiveWriter, dir: &str, version z, &format!("{dir}/index.json"), craft_figcraft_format::Compression::Level(3), - &serde_json::to_vec(&NativeVersionIndex { versions: index }).map_err(io_err)?, + &craft_figcraft_format::write_version_index(&NativeVersionIndex { versions: index }).map_err(io_err)?, )?; Ok(()) } @@ -738,7 +738,7 @@ fn read_versions( } let index = match unpacked .read(z, &index_name, MAX_VERSION_INDEX) - .and_then(|b| serde_json::from_slice::(&b).map_err(|e| FormatError::Corrupt(e.to_string()))) + .and_then(|b| craft_figcraft_format::read_version_index(&b).map_err(|e| FormatError::Corrupt(e.to_string()))) { Ok(v) => v, Err(e) => { @@ -791,7 +791,7 @@ fn read_branches( } let index = match unpacked .read(z, BRANCH_INDEX, MAX_VERSION_INDEX) - .and_then(|b| serde_json::from_slice::(&b).map_err(|e| FormatError::Corrupt(e.to_string()))) + .and_then(|b| craft_figcraft_format::read_branch_index(&b).map_err(|e| FormatError::Corrupt(e.to_string()))) { Ok(v) => v, Err(e) => {