From d00b5d2a96d123061e7d53e73b19b88269c74ced Mon Sep 17 00:00:00 2001 From: beerpsi Date: Wed, 3 Jan 2024 01:16:10 +0700 Subject: [PATCH] use the new is_prerelease impl --- src/icf/mod.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/icf/mod.rs b/src/icf/mod.rs index 6d68518..d0fffbb 100644 --- a/src/icf/mod.rs +++ b/src/icf/mod.rs @@ -270,16 +270,7 @@ pub fn serialize_icf(data: &[IcfData]) -> Result> { let mut app_id: Option = None; for container in data { - // I don't think there's a really good way to do this? - // 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 { + if container.is_prerelease() { icf.extend([0x01, 0x02, 0x00, 0x00]); } else { icf.extend([0x02, 0x01, 0x00, 0x00]);