fix: expose AllowedYanks (#2608)

## Summary

If I see correctly, this is used in the interface of
`DefaultResolverProvider` but not accessible outside.
This commit is contained in:
Wolf Vollprecht 2024-03-22 10:15:22 -04:00 committed by GitHub
parent a4fb2ad739
commit 68432e77e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View file

@ -13,7 +13,7 @@ use crate::Manifest;
pub struct AllowedYanks(FxHashMap<PackageName, FxHashSet<Version>>);
impl AllowedYanks {
pub(crate) fn from_manifest(manifest: &Manifest, markers: &MarkerEnvironment) -> Self {
pub fn from_manifest(manifest: &Manifest, markers: &MarkerEnvironment) -> Self {
let mut allowed_yanks = FxHashMap::<PackageName, FxHashSet<Version>>::default();
for requirement in manifest
.requirements
@ -52,10 +52,7 @@ impl AllowedYanks {
/// Returns versions for the given package which are allowed even if marked as yanked by the
/// relevant index.
pub(crate) fn allowed_versions(
&self,
package_name: &PackageName,
) -> Option<&FxHashSet<Version>> {
pub fn allowed_versions(&self, package_name: &PackageName) -> Option<&FxHashSet<Version>> {
self.0.get(package_name)
}
}