-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement RangeEnd, Range #19
Conversation
Implements Willow’s one-dimensional ‘range’ grouping as described here: https://willowprotocol.org/specs/grouping-entries/index.html#range
Looks good! And cool that my code from iroh-willow is of direct use here :-) |
Btw, I think that all functions that deal with potentially empty ranges should either use Option or Result<Range, RangeError>, but no mixture (currently, intersecting yields an Option, but closed creation a Result). |
@AljoschaMeyer sure. I think it makes more sense for creation to be an |
Implements Willow’s one-dimensional ‘range’ grouping as described here, with testing for value inclusion, range inclusion, intersection creation, and a method which creates a range including all values of that type.
While it's still possible to create empty ranges by initialising a
Range
directly, attempting to do so withnew_closed
will return aEmptyRangeError
.This is a draft while I add some
fuzzingtests, but I think the implementation is ready to look at!