Adds ordering on loader fields enum (#755)

* now sorts on ordering, fmt clippy prepare

* fixed tests

* removed accidenetal printlns
This commit is contained in:
Wyatt Verchere
2023-11-13 18:19:06 -08:00
committed by GitHub
parent ae1c5342f2
commit 375f992a0c
11 changed files with 56 additions and 32 deletions

View File

@@ -179,7 +179,7 @@ async fn find_version(
// Try to parse version filters from version coords.
let Some((vnumber, filter)) = vcoords.rsplit_once('-') else {
return Ok(exact_matches.get(0).map(|x| (*x).clone()));
return Ok(exact_matches.first().map(|x| (*x).clone()));
};
let db_loaders: HashSet<String> = Loader::list(pool, redis)
@@ -221,8 +221,8 @@ async fn find_version(
.collect::<Vec<_>>();
Ok(matched
.get(0)
.or_else(|| exact_matches.get(0))
.first()
.or_else(|| exact_matches.first())
.copied()
.cloned())
}