From cde5fb702d84449b4e49bf937abf0cc518823beb Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 12 Jan 2023 22:34:21 +0900 Subject: [PATCH] codegen: Fix handling of latest_only tool --- tools/codegen/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/codegen/src/main.rs b/tools/codegen/src/main.rs index ab511127..93545276 100644 --- a/tools/codegen/src/main.rs +++ b/tools/codegen/src/main.rs @@ -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();