mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-02 04:48:18 +00:00
Remove Range::bounds usage (#2363)
I'm trying to reduce our pubgrub upstream divergences and since we only have one usage of our custom `Range::bounds` it seems more reasonable to do this in uv directly than in pubgrub (https://github.com/pubgrub-rs/pubgrub/pull/188#issuecomment-1989410636).
This commit is contained in:
parent
85483e88a4
commit
0118358835
1 changed files with 15 additions and 1 deletions
|
|
@ -357,7 +357,21 @@ impl PubGrubReportFormatter<'_> {
|
|||
External::NoVersions(package, set, _) => {
|
||||
// Check for no versions due to pre-release options
|
||||
if let Some(selector) = selector {
|
||||
if set.bounds().any(Version::any_prerelease) {
|
||||
let any_prerelease = set.iter().any(|(start, end)| {
|
||||
let is_pre1 = match start {
|
||||
Bound::Included(version) => version.any_prerelease(),
|
||||
Bound::Excluded(version) => version.any_prerelease(),
|
||||
Bound::Unbounded => false,
|
||||
};
|
||||
let is_pre2 = match end {
|
||||
Bound::Included(version) => version.any_prerelease(),
|
||||
Bound::Excluded(version) => version.any_prerelease(),
|
||||
Bound::Unbounded => false,
|
||||
};
|
||||
is_pre1 || is_pre2
|
||||
});
|
||||
|
||||
if any_prerelease {
|
||||
// A pre-release marker appeared in the version requirements.
|
||||
if !allowed_prerelease(package, selector) {
|
||||
hints.insert(PubGrubHint::PreReleaseRequested {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue