Repository navigation
Change type of end field in slices to Bound - #480
Closed
jturner314 wants to merge 1 commit into
Closed
jturner314 wants to merge 1 commit into
jturner314 wants to merge 1 commit into
Conversation
jturner314
force-pushed
the
slice-end-bound
branch
from
August 28, 2018 01:47
66c9bdc to
7455fa4
Compare
Change type of `Slice.end` and `SliceOrIndex::Slice.end` from `Option<isize>` to `Bound<isize>`.
jturner314
force-pushed
the
slice-end-bound
branch
from
August 28, 2018 02:09
7455fa4 to
8f4d417
Compare
Closed
Member
|
Pretty ambivalent / I'd decline the complication since we should do this to get the upsides, not just because we can. So with a plan, it could be good. |
Member
Author
|
Okay, I'll close this. I don't see any significant upsides, so we might as well avoid unnecessary breakage. If we find a specific use-case in the future, we can always make this change then. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I just noticed the
Boundenum in the standard library while I was reading about the newRangeBoundstrait. I thought I'd propose switching to theBoundtype, now that we have support for inclusive ranges (#467). There is no memory cost to doing this (sinceBound<isize>andOption<isize>are the same size). This is a breaking change.I'm pretty ambivalent about this PR, since
Optionhas the benefit of being more common thanBoundand having lots of convenient methods. It's also nice to only have to deal with exclusive end bounds after theSlice/SliceOrIndexis created. So, I'm curious to see what everyone thinks about this change.