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

feat: inclusive/exclusive bounds #80

Merged
merged 5 commits into from
Nov 12, 2024
Merged

feat: inclusive/exclusive bounds #80

merged 5 commits into from
Nov 12, 2024

Conversation

uint
Copy link
Collaborator

@uint uint commented Oct 30, 2024

Closes #71

TODO:

  • more tests maybe?
  • docs update
  • consider using the range syntax (1..=5) for bounded iteration in collections

@uint uint marked this pull request as ready for review November 4, 2024 17:38
Copy link

@jawoznia jawoznia left a comment

Choose a reason for hiding this comment

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

I don't feel competent enough to approve this PR, but overall seems like a nice change.

I left one comment to consider

@@ -651,21 +669,21 @@ mod tests {
// start unset
assert_eq!(
access
.bounded_pairs(None, Some(5))
.bounded_pairs(Bound::Included(1), Bound::Excluded(5))
Copy link

Choose a reason for hiding this comment

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

Shouldn't it be unbounded if we want the start to be unset?

Suggested change
.bounded_pairs(Bound::Included(1), Bound::Excluded(5))
.bounded_pairs(Bound::Unbounded, Bound::Excluded(5))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I probably messed up refactoring. Thanks!

@uint uint merged commit c8ea56c into main Nov 12, 2024
2 checks passed
@uint uint deleted the 71-exclusive-bounds branch November 12, 2024 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for exclusive bounds
2 participants