use the new is_prerelease impl

This commit is contained in:
beerpsi 2024-01-03 01:16:10 +07:00
parent 401fb278cc
commit d00b5d2a96

View File

@ -270,16 +270,7 @@ pub fn serialize_icf(data: &[IcfData]) -> Result<Vec<u8>> {
let mut app_id: Option<String> = None; let mut app_id: Option<String> = None;
for container in data { for container in data {
// I don't think there's a really good way to do this? if container.is_prerelease() {
// At least, not without breaking backwards compatibility.
let is_prerelease = match container {
IcfData::System(s) => s.is_prerelease,
IcfData::App(a) => a.is_prerelease,
IcfData::Option(o) => o.is_prerelease,
IcfData::Patch(p) => p.is_prerelease,
};
if is_prerelease {
icf.extend([0x01, 0x02, 0x00, 0x00]); icf.extend([0x01, 0x02, 0x00, 0x00]);
} else { } else {
icf.extend([0x02, 0x01, 0x00, 0x00]); icf.extend([0x02, 0x01, 0x00, 0x00]);