From f1ff88f452c03c2e0900250422cd76afd83f02a9 Mon Sep 17 00:00:00 2001 From: BasiqueEvangelist Date: Thu, 12 Oct 2023 00:01:32 +0300 Subject: [PATCH] fix maven filters for versions with dashes (#725) Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com> --- src/routes/maven.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/maven.rs b/src/routes/maven.rs index e5641106..ae19b7cf 100644 --- a/src/routes/maven.rs +++ b/src/routes/maven.rs @@ -191,7 +191,7 @@ async fn find_version( .partition::, _>(|el| db_loaders.contains(el)); let matched = all_versions - .into_iter() + .iter() .filter(|x| { let mut bool = x.inner.version_number == vnumber; @@ -206,7 +206,7 @@ async fn find_version( }) .collect::>(); - Ok(matched.get(0).cloned()) + Ok(matched.get(0).or_else(|| exact_matches.get(0)).copied().cloned()) } fn find_file<'a>(