Merge pull request #122 from somehowchris/feature/ignore-yanked

fix: ignore crate version if yanked
This commit is contained in:
Ryan 2022-05-01 11:43:41 +12:00 committed by GitHub
commit 60fc30461e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,7 +83,13 @@ pub async fn fetch_crate_cratesio(
};
// Locate matching version
let version_iter = base_info.versions().iter().map(|v| v.version());
let version_iter = base_info.versions().iter().filter_map(|v| {
if !v.is_yanked() {
Some(v.version())
} else {
None
}
});
let version_name = find_version(version_req, version_iter)?;
// Build crates.io api client