codegen: Fix handling of latest_only tool

This commit is contained in:
Taiki Endo
2023-01-12 22:34:21 +09:00
parent c37d86a473
commit cde5fb702d

View File

@@ -287,9 +287,10 @@ fn main() -> Result<()> {
}
if latest_only {
let ManifestRef::Ref { version } = manifests.map.first_key_value().unwrap().1.clone() else { unreachable!() };
manifests
.map
.retain(|k, m| k.0 == Version::latest() || matches!(m, ManifestRef::Real(..)));
.retain(|k, _| k.0 == Version::latest() || k.0 == version);
}
let original_manifests = manifests.clone();