Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid 'are incompatible' for singular bounded versions #4003

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

charliermarsh
Copy link
Member

Summary

Not sure if this is worth the complexity, but it does read better.

@charliermarsh charliermarsh added the error messages Messaging when something goes wrong label Jun 3, 2024
@charliermarsh charliermarsh marked this pull request as ready for review June 4, 2024 00:03
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems okay. We have similar complexity for singular and plural cases of PackageRange.

The logic in PackageRange looks a bit different, can you make sure these implementations are consistent?

fn plural(&self) -> bool {
if self.range.is_empty() {
false
} else {
let segments: Vec<_> = self.range.iter().collect();
// "all versions of" is the only plural case
matches!(segments.as_slice(), [(Bound::Unbounded, Bound::Unbounded)])
}
}

@charliermarsh
Copy link
Member Author

Will do, thanks.

@charliermarsh
Copy link
Member Author

Thanks, I decided to reuse is_plural.

@charliermarsh charliermarsh enabled auto-merge (squash) June 4, 2024 19:12
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@charliermarsh charliermarsh merged commit 420333a into main Jun 4, 2024
46 checks passed
@charliermarsh charliermarsh deleted the charlie/is branch June 4, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants